Coachmark {shiny.fluent}R Documentation

Coachmark

Description

Coach marks (Coachmark) are used to draw a person’s attention to parts of the UI and increase engagement with those elements. A teaching bubble appears on hover or selection of the coach mark.

For more details and examples visit the official docs. The R package cannot handle each and every case, so for advanced use cases you need to work using the original docs to achieve the desired result.

Usage

Coachmark(...)

Arguments

...

Props to pass to the component. The allowed props are listed below in the Details section.

Details

Value

Object with shiny.tag class suitable for use in the UI of a Shiny app.

Best practices

Layout

Examples

library(shiny.fluent)

if (interactive()) {
  shinyApp(
    ui = tagList(
      uiOutput("coachmark"),
      DefaultButton.shinyInput("toggleCoachmark",
        id = "target", text = "Toggle coachmark"
      )
    ),
    server = function(input, output) {
      coachmarkVisible <- reactiveVal(FALSE)
      observeEvent(input$toggleCoachmark, coachmarkVisible(!coachmarkVisible()))
      observeEvent(input$hideCoachmark, coachmarkVisible(FALSE))
      output$coachmark <- renderUI({
        if (coachmarkVisible()) Coachmark(
          target = "#target",
          TeachingBubbleContent(
            hasCloseButton = TRUE,
            onDismiss = triggerEvent("hideCoachmark"),
            headline = "Example title",
            primaryButtonProps = list(text = "Try it"),
            secondaryButtonProps = list(text = "Try it again"),
            "Welcome to the land of coachmarks!"
          )
        )
      })
    }
  )
}

[Package shiny.fluent version 0.3.0 Index]