add_description {savonliquide}R Documentation

Add a description to an HTML element

Description

Add a description to an HTML element

Usage

add_description(element, descID, description, visible = FALSE)

Arguments

element

an HTML element to describe

descID

the ID of the div that will describe the HTML element

description

the description of the HTML element

visible

should the description be visible ? Defaults to FALSE

Value

an HTML element with a description attached to it

Examples


if (interactive()) {
  ui <- fluidPage(
    h2("Using a screen reader
        hit <Tab> or <Shift + Tab> to
        navigate between the buttons
        and stop at button 5 to see the difference"),

    actionButton(
      inputId = "inp1",
      label = "button 1"
    ),
    actionButton(
      inputId = "inp2",
      label = "button 2"
    ),
    actionButton(
      inputId = "inp3",
      label = "button 3"
    ),
    actionButton(
      inputId = "inp4",
      label = "button 4"
    ),
    actionButton(
      inputId = "inp5",
      label = "button 5"
    ) %>%
      add_description(
        description = "hello this is a button
                   when you click it you'll have a
                   thing, when you don't click it you'll
                   have another thing",
        descID = "chkoup"
      )
  )

  server <- function(input, output, session) {}

  shinyApp(ui, server)
}

[Package savonliquide version 0.2.0 Index]