ijlyttle / bsplus

Shiny and R Markdown addons to Bootstrap 3
http://ijlyttle.github.io/bsplus/
Other
147 stars 23 forks source link

Compatibility with Bootstrap 5 #103

Open mubashirqasim opened 1 year ago

mubashirqasim commented 1 year ago

Great package. I am developing with Bootstrap 5. Some of the functions are not available with bootstrap 5. I wonder if there is any way to update the package compatibility with Bootstrap 5.

library(shiny)
library(bsplus)

ui <- fluidPage(

  theme = bs_theme(bootswatch = "sandstone", version = 5),

  # activate tooltips, popovers, and MathJax
  use_bs_tooltip(),
  use_bs_popover(),

  # Application title
  titlePanel("Tooltips, Popovers, and Modals"),

  # Sidebar with a slider input for number of bins
  sidebarLayout(
    sidebarPanel(
      numericInput("number", label = "Label with tooltip help", value = 0) %>%
        shinyInput_label_embed( icon("info") %>% bs_embed_tooltip(title = "Not a complex number")),

      selectInput("letter", label = "Label with popover help", choices = c("a", "b", "c")) %>%
        shinyInput_label_embed(shiny_iconlink() %>% bs_embed_popover(
          title = "Letter", content = "Choose a favorite", placement = "left")),

      bs_modal("modal_equation", title = "Equations", 
               body = includeMarkdown(system.file("markdown", "modal.md", package = "bsplus")),
               size = "medium"),

      selectInput(inputId = "equation", label = "Label with modal help", 
                  choices = c("F = ma", "E = mc^2")) %>%
        shinyInput_label_embed( shiny_iconlink() %>% bs_attach_modal(id_modal = "modal_equation"))
    ),
    mainPanel(
      textOutput("number"),
      textOutput("letter"),
      textOutput("equation")
    )
  )
)

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

# Run the application
shinyApp(ui = ui, server = server)