I have a shinyapp with a navbar and a default theme.
I want to add a help button in one place in my application that displays a popup when you move the mouse over it.
I noticed that using a theme with a boostrap version > 3 inhibited the popup from working. with version = 3 it works normally
Here is a reproducible example :
library(shiny)
library(bslib)
library(shinyBS)
ui <- navbarPage(
title = "Shiny",
theme = bslib::bs_theme(bootswatch = "cosmo", version = 3), # not working with version = 4 or version = 5
tabPanel(
"Tab 1",
fluidPage(
mainPanel(
bsButton("popupBtn", label = "?", style = "info")
)
)
)
)
server <- function(input, output, session) {
shinyBS::addPopover(
session,
"popupBtn",
"Data",
content = paste0("Mon texte"),
trigger = 'hover'
)
}
shinyApp(ui, server)
If anyone has a trick to make the theme work with version = 5 and the popup
Here is the way:
Here is the documentation.