Jorge Hernández
Jorge Hernández

Reputation: 662

How I can add the parameter "All" on a SelectInput in shiny?

and thanks for reading and helping me.

I have a list of grades that has the names of the students and I am making a shiny app with it. I added a SelectInput to choose the students, but I would like to know if it is possible to add a row in the SelectInput with the option "All".

Anyone know how I can add this? The code for the selectinput is the following:

ui <- fluidPage(
  
  selectInput("alumnos", "Selecciona a un alumno:",
              choices = asistencias$Alumno
              )
  
) 

Upvotes: 0

Views: 38

Answers (1)

Ronak Shah
Ronak Shah

Reputation: 389155

You may try using pickerInput from shinyWidgets package.

library(shiny)

ui <- fluidPage(
  
    shinyWidgets::pickerInput("alumnos", "Selecciona a un alumno:",
              choices = unique(mtcars$cyl), multiple = TRUE,
              options = list(`actions-box` = TRUE)
  )
) 
server <- function(input, output) {}

shinyApp(ui, server)

enter image description here

Upvotes: 1

Related Questions