Search code examples
rshinyshinyappsselectinput

create a resizable selectInput window in shiny app


I saw a shiny app, here which uses a resizable selectInput but couldn't figure out how it's been developed. I wonder if anybody has any idea?

enter image description here


Solution

  • library(shiny)
    
    css <- "select {resize: vertical; overflow: auto;}"
    
    shinyApp(
      
      ui = fluidPage(
        tags$head(tags$style(HTML(css))),
        selectInput(
          "variable", "Variable:", names(mtcars), selectize = FALSE, size = 5L
        )
      ),
      
      server = function(input, output) {
        
      }
      
    )