toggle_info: Toggle showing info with keyboard shortcut

Description Usage Arguments Details Value Examples

View source: R/hide.R

Description

Toggle showing info with keyboard shortcut

Usage

1
toggle_info(shortcut = "Ctrl+Shift+K", hidden_on_start = TRUE)

Arguments

shortcut

keys that trigger showing info. Shortcut can include special keys: Ctrl, Alt, Shift. Keys should be separated with '+' sign. Default Ctrl+Shift+K

hidden_on_start

should info panels be hidden on start of the application? Default TRUE.

Details

toggle_info() should be added in the header of the application in ui.R, since it adds a script with toggle functionality. If you want to use it with info_value, you have to add outputOptions(output, [info value id], suspendWhenHidden = FALSE) to force rendering when the value is hidden.

Value

JS script that adds toggle functionality.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
if (interactive()){
library(shiny)
library(shiny.info)

ui <- fluidPage(
  toggle_info(),
  shiny.info::display("test message"),
  shiny.info::info_value("test_input_value", "bottom right"),
  textInput(inputId = "test_input", label = NULL)
)

server <- function(input, output, session) {
  output$test_input_value <- shiny.info::render_info_value(input$test_input)
  outputOptions(output, "test_input_value", suspendWhenHidden = FALSE)
}

shinyApp(ui = ui, server = server)
}

shiny.info documentation built on March 23, 2020, 5:07 p.m.