Skip to content

Error when using bslib component in Bootstrap 4 Shiny app #1207

Open
@hsujiakai

Description

@hsujiakai

Describe the problem

Hi,

After upgrading the bslib package to the latest version (0.9.0), our app throws an error when I try to specify Bootstrap v4 in Shiny UI and use a bslib component like nav_spacer.
The error message is: 'Error in component_dependency_sass: bslib components require Bootstrap 5 or higher.'

However, it did work before we upgraded the bslib package (when it was version 0.5.1).

I'm wondering if the latest bslib package no longer supports older Bootstrap versions or it's a compatibility issue?

Here is a simple example code:

library(shiny)
library(bslib)

ui <- fluidPage(
  
  theme = bslib::bs_theme(version = 4),
  
  shiny::navbarPage(
    title = "Example",
    shiny::tabPanel(
      title = "Tab 1",
      value = "tab1"
    ),
    bslib::nav_spacer(),
    shiny::tabPanel(
      title = "Tab 2",
      value = "tab2"
    )
  )
)

server <- function(input, output, session) {
  
}

shinyApp(ui, server)

Session Info


Place your devtools::session_info() here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions