Blur 'HTML' Elements in 'Shiny' Applications Using 'Spoiler-Alert.js'

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.


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)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("spoiler")

1.0.0 by Etienne Bacher, 5 years ago


https://github.com/etiennebacher/spoiler


Report a bug at https://github.com/etiennebacher/spoiler/issues


Browse source code at https://github.com/cran/spoiler


Authors: Etienne Bacher [aut, cre, cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports htmltools, shiny

Suggests spelling


See at CRAN