Description Usage Arguments Examples
Change the value of a rating input on the client. Check
rating_input
to learn more.
1 | update_rating_input(session, input_id, label = NULL, value = NULL)
|
session |
shiny object with session info |
input_id |
rating input name |
label |
character with updated label |
value |
new rating value |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Only run examples in interactive R sessions
if (interactive()) {
library(shiny)
library(shiny.semantic)
ui <- shinyUI(
semanticPage(
rating_input("rate", "How do you like it?", max = 5,
icon = "heart", color = "yellow"),
numeric_input("numeric_in", "", 0, min = 0, max = 5)
)
)
server <- function(session, input, output) {
observeEvent(input$numeric_in, {
x <- input$numeric_in
update_rating_input(session, "rate", value = x)
}
)
}
shinyApp(ui = ui, server = server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.