introjs {rintrojs} | R Documentation |
Initiate intro.js
Description
Initiates an introduction via the intro.js library
Usage
introjs(session, options = list(), events = list())
hintjs(session, options = list(), events = list())
Arguments
session |
the Shiny session object (from the server function of the Shiny app) |
options |
List of options to be passed to intro.js |
events |
List of text that are the body of a Javascript function. Must wrap in |
Note
For documentation on intro.js options and events, see https://introjs.com/docs/.
See Also
Examples
## Not run:
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)
## End(Not run)
[Package rintrojs version 0.3.4 Index]