1

I'm trying to embed a real-time bslib theme into my shiny app. It was working previously, and when I try it on a new plain shiny app it works, but for some reasons, I keep receiving the same error when I run my shiny app:

Error : bslib::bs_themer() requires shiny::bootstrapLib() to be present in the app's UI. Consider providing bslib::bs_theme() to the theme argument of the relevant page layout function (or, more generally, adding bootstrapLib(bs_theme()) to the UI.

I appreciate your support. Here is my code:

ui <- navbarPage(theme = bs_theme(), h4(""),
                  tabPanel(
                    title = h6(""),

dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
    sidebarMenu()),
                                                          
dashboardBody(
  fluidRow(
    box(plotlyOutput(outputId = "plotly_1"), height = 300),
    box(plotlyOutput(outputId = "plotly"), height = 300 )),
  fluidRow(column(12),
    box(DTOutput(outputId = "dt_output"), height = 300),
  )))),
        
tabPanel(title = h6(""),
                                             
dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
    sidebarMenu()),

dashboardBody(
  fluidRow(
    box(plotlyOutput(outputId = "plotly_2"), height = 300),
    box(plotlyOutput(outputId = "plotly_3"), height = 300 )),
  ))))                 


server <- function(input, output, session) {
  
bs_themer()
  
 
output$plotly_1 <- renderPlotly ({})
  
output$plotly <- renderPlotly ({})
 
output$dt_output <- DT:: renderDataTable ()
     
}
shinyApp(ui = ui, server = server)'
  • Update: It appears the bslib::bs_themer() only works with rmarkdown document runtime: shiny. However, in the shiny app I used shinythemes::themeSelector() in the UI, and it worked fine. – Sami Khamash Nov 02 '22 at 08:58

0 Answers0