Skip to content

Add Cicerone #55

@arnfinn

Description

@arnfinn

https://github.com/JohnCoene/cicerone

Simple example:

library(cicerone)

guide <- Cicerone$
  new(opacity = 0.1)$ 
  step(
    el = "text",
    title = "Text Input",
    description = "This is where you enter the text you want to print."
  )$
  step(
    el = "submit",
    title = "Send the Text",
    description = "Send the text to the server for printing"
  )

library(shiny)

ui <- fluidPage(
  use_cicerone(), # include dependencies
  actionButton("guide", "Start guide"),
  textInput("text", "Enter some more text and text"),
  actionButton("submit", "Submit text"),
  verbatimTextOutput("print")
)

server <- function(input, output){
  
  # initialise the guide
  guide$init()
  
  txt <- eventReactive(input$submit, {
    input$text
  })
  
  output$print <- renderPrint(txt())
  
  observeEvent(input$guide, {
    guide$start()
  })
}

shinyApp(ui, server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions