R shiny bslib sidebar and shinyWidgets pickerInput incompatible
13:55 05 Mar 2026

I have a rather large shiny app that uses the sidebar feature from bslib and has the user select input values to generate a table. I need to use some of the features available in pickerInput from shinyWidgets but either sidebar or pickerInput fail when I use them together. In the case of the sidebar failure, no sidebar appears, and in the case of pickerInput failure, the choices do not populate.

The following minimal example reproduces the error.

Running this as posted gives the desired look but the drop-down boxes, and consequently the table, remain empty.

Removing the page_sidebar and keeping or also removing sidebar gives the desired behavior as far as user interface and table output but there's no sidebar. In this example, the sidebar is empty but in the real app the sidebar contains necessary information for the user.

Replacing the choices with a fixed array e.g. choices = c("A", "B", "C") does not help.

Any thoughts on how to fix this?


library(tidyverse)
library(shiny)
library(bslib)


met_data <- data.frame(
  STATE = rep(c("Alabama", "Arkansas", "Maine", "Minnesota", "Texas"), 4),
  MET_VAR = rep(c('degC', 'rain', 'ice', 'humidity'), 5),
  RESULT = rnorm(20)
)


ui <- fluidPage( # open fluidPage
  
  page_sidebar( # open page_sidebar
  
  sidebar = sidebar( # open sidebar

    style = "position:fixed",

    bg = "#C8CBD2",

    width = 350,
    
    h3("Example sidebar")

  ), # close sidebar
  
  mainPanel( # open mainPanel
    
    width = 1400,
    
    # Input: choose state(s)
    shinyWidgets::pickerInput(
      inputId = 'stateInput',
      label = "Select State",
      choices = sort(
        unique(
          met_data$STATE
        )
      ),
      options = list(`actions-box` = TRUE),
      multiple = TRUE
    ),
    
    # Input: choose met variable(s)
    shinyWidgets::pickerInput(
      inputId = 'Met_variable',
      label = "Select Variable",
      choices = sort(
        unique(
          met_data$MET_VAR
        )
      ),
      options = list(`actions-box` = TRUE),
      multiple = TRUE
    ),
    
    
    # DX US met data --------------------------------------------------------
    
    DT::dataTableOutput("report_table")
    
  ), # close mainPanel
  
  ) # close page_sidebar
  
) # close fluidPage


server <- function(input, output, session) {
  
  report_data <- reactive({
    
    met_data %>% 
      filter(
        STATE %in% input$stateInput &
          MET_VAR %in% input$Met_variable
      ) %>% 
      arrange(
        .$STATE
      ) %>%
      mutate(
        STATE = factor(STATE),
        MET_VAR = factor(MET_VAR)
      )
    
  })
  
  output$report_table <- DT::renderDataTable({
    
    report_data()|>
      DT::datatable(
        {},
        escape = FALSE,
        filter = "top",
        options = list(
          scrollX = TRUE,
          autowidth = TRUE
        )
      )
    
  })
  
}

shinyApp(ui = ui, server = server)

r shiny shinywidgets bslib pickerinput