Description
Blur 'HTML' Elements in 'Shiny' Applications Using 'Spoiler-Alert.js'.
Description
It can be useful to temporarily hide some text or other HTML elements in 'Shiny' applications. Building on 'Spoiler-Alert.js', it is possible to select the elements to hide at startup, to partially reveal them by hovering them, and to completely show them when clicking on them.
README.md
spoiler
The goal of {spoiler}
is to blur any HTML elements (text, plots, etc.) in R Shiny apps, so that spoilers are avoided.
Installation
You can install the GitHub version of {spoiler}
with:
# install.packages("devtools")
devtools::install_github("etiennebacher/spoiler")
Demo
library(shiny)
library(spoiler)
# works better in browser
ui <- fluidPage(
use_spoiler(),
column(
4,
spoiler(plotOutput("test"))
),
hide_spoilers(max = 10, partial = 4)
)
server <- function(input, output, session) {
output$test <- renderPlot(plot(mtcars$mpg))
}
shinyApp(ui, server)