add_description: Add a description to an HTML element

Description Usage Arguments Value Examples

View source: R/add_description.R

Description

Add a description to an HTML element

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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)
}

savonliquide documentation built on Feb. 23, 2021, 1:07 a.m.