Initiates an introduction via the intro.js library
the Shiny session object (from the server function of the Shiny app)
List of options to be passed to intro.js
List of text that are the body of a Javascript function. Must wrap in I()
For documentation on intro.js options and events, see https://introjs.com/docs/.
if (FALSE) {
library(rintrojs)
library(shiny)
ui <- shinyUI(fluidPage(
introjsUI(), # must include in UI
mainPanel(
introBox(
tableOutput("mtcars"),
data.step = 1,
data.intro = "This is the table"
),
introBox(
actionButton("btn","Intro"),
data.step = 2,
data.intro = "This is the button",
data.hint = "Here is clue"
)
)))
server <- shinyServer(function(input, output, session) {
hintjs(session, options = list("hintButtonLabel"="That was a hint"))
output$mtcars <- renderTable({
head(mtcars)
})
observeEvent(input$btn,
introjs(session, options = list("nextLabel"="Onwards and Upwards"),
events = list("oncomplete"=I('alert("It is over")'))))
})
# Run the application
shinyApp(ui = ui, server = server)
}