Stéphane Laurent
Stéphane Laurent

Reputation: 84709

Alternative to shinyBS::popify with Bootstrap 4

I'm using Bootstrap 4 in my Shiny app, with the help of the bslib package. Then the popovers made with shinyBS::popify do not work. Is there an alternative, or a way to make them work?

library(shiny)
library(shinyBS)
library(bslib)

ui <- fluidPage(
  theme = bs_theme(version = 4, bootswatch = "united"),
  popify(
    bsButton("pointlessButton", "Button", style = "primary", size = "large"),
    "A Pointless Button",
    "This button is <b>pointless</b>. It does not do <em>anything</em>!"
  )
)

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

shinyApp(ui, server)

Upvotes: 0

Views: 216

Answers (1)

lz100
lz100

Reputation: 7360

You can try spsComps, it works with BS4

library(shiny)
library(shinyBS)
library(bslib)
library(spsComps)
ui <- fluidPage(
    theme = bs_theme(version = 4, bootswatch = "united"),
    bsPopover(
        bsButton("pointlessButton", "Button", style = "primary", size = "large"),
        "A Pointless Button",
        "This button is <b>pointless</b>. It does not do <em>anything</em>!",
        "bottom", html = T
    )
)

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

shinyApp(ui, server)

enter image description here

Upvotes: 1

Related Questions