Skip to contents

Include ratings in shiny UI

Usage

shinyRatings(inputId, no_of_stars = 5, default = no_of_stars, disabled = FALSE)

Arguments

inputId

The input slot that will be used to access the value of number of stars.

no_of_stars

Number of stars that you want to display on the UI.

default

Number of stars selected by default.

disabled

Keep number of stars as fixed? Disable the option of changing values

Value

Ratings to be added to UI definition

Examples

if(interactive()){
 library(shiny)
 library(shinyRatings)

ui <- fluidPage(
  shinyRatings('star'), 
  textOutput('text')
)

server <- function(input, output, session) {
   output$text <- renderText({paste("No. of stars : ", input$star)})
}

shinyApp(ui, server)
}