Learn R Programming

shinyFeedback (version 0.0.3)

feedbackSuccess: feedbackSuccess

Description

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

Usage

feedbackSuccess(inputId, condition, text = NULL, color = "#5cb85c",
  icon = shiny::icon("ok", lib = "glyphicon"))

Arguments

inputId

the Shiny input's inputId argument

condition

condition under which feeback is displayed

text

default NULL text string to display below input

color

defailt "#5cb85c" the color of the feeback

icon

default icon("ok", lib="glyphicon")) a shiny::icon object

See Also

feedback, feedbackDanger, feedbackSuccess

Other feedback wrappers: feedbackDanger, 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, {
      feedbackSuccess(
        "exampleInput",
        condition = input$exampleInput < 0
      )
    })
  }
  
  shinyApp(ui, server)
}

# }

Run the code above in your browser using DataLab