introBox: Generate intro elements in UI

View source: R/introjs.R

introBoxR Documentation

Generate intro elements in UI

Description

Wrap introBox around elements you want to include in introduction. Use data.step to order the boxes and data.intro to specify the comment in the introduction

Usage

introBox(
  ...,
  data.step,
  data.intro,
  data.hint,
  data.position = c("bottom", "auto", "top", "left", "right", "bottom",
    "bottom-left_aligned", "bottom-middle-aligned", "bottom-right-aligned", "auto")
)

Arguments

...

Elements in introduction element

data.step

a number indicating its spot in the order in the intro

data.intro

text for introduction

data.hint

text for clickable hints

data.position

position of intro

See Also

introjsUI() introjs()

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"
    )
  )))
server <- shinyServer(function(input, output, session) {
  output$mtcars <- renderTable({
    head(mtcars)
  })
  observeEvent(input$btn,
               introjs(session))
})
# Run the application
shinyApp(ui = ui, server = server)

## End(Not run)

carlganz/rintrojs documentation built on Feb. 2, 2024, 3:58 a.m.