Learn R Programming

rintrojs (version 0.3.4)

introjs: 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 I()

See Also

introjsUI() introBox()

Examples

Run this code
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)
}

Run the code above in your browser using DataLab