rating_input | R Documentation |
Crates rating component
rating_input(
input_id,
label = "",
value = 0,
max = 3,
icon = "star",
color = "yellow",
size = ""
)
input_id |
The |
label |
the contents of the item to display |
value |
initial rating value |
max |
maximum value |
icon |
character with name of the icon or |
color |
character with colour name |
size |
character with legal semantic size, eg. "medium", "huge", "tiny" |
rating object
## 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"),
)
)
server <- function(input, output) {
observeEvent(input$rate,{print(input$rate)})
}
shinyApp(ui = ui, server = server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.