Learn R Programming

shinyFeedback (version 0.0.3)

feedbackDanger: feedbackDanger

Description

wrapper for feedback() function that displays a danger message by default

Usage

feedbackDanger(inputId, condition, text = "Danger, turn back!",
  color = "#d9534f", icon = shiny::icon("exclamation-sign", lib =
  "glyphicon"))

Arguments

inputId

the Shiny input's inputId argument

condition

condition under which feeback is displayed

text

default "Danger, turn back" text string to display below input

color

defailt "#d9534f" the color of the feeback

icon

default icon("exclamation-sign", lib="glyphicon")) a shiny::icon object

See Also

feedback, feedbackWarning, feedbackSuccess

Other feedback wrappers: feedbackSuccess, feedbackWarning

Examples

Run this code
# NOT RUN {
## Only run examples in interacive R sessions
if (interactive()) {
  ui <- fluidPage(
    useShinyFeedback(),
    
    numericInput(
      "exampleInput",
      "Show Feedback When < 0",
      value = -5
    )
  )
  
  server <- function(input, output) {
    observeEvent(input$exampleInput, {
      feedbackDanger(
        "exampleInput",
        condition = input$exampleInput < 0
      )
    })
  }
  
  shinyApp(ui, server)
}

# }

Run the code above in your browser using DataLab