When I try to use the Vertical Tabset in addition to using Bootstrap5, the content of the tab shows up below the tab buttons vice to thg right as expected.
library(shiny)
library(shinyBS)
library(shinyWidgets)
library(bslib)
ui <- shinyUI(fluidPage(
theme = bs_theme(version = 5, bootswatch = 'sandstone'),
titlePanel("Example"),
sidebarLayout(
sidebarPanel(
selectInput("decision", label = "Choose your species",
choices = unique(iris$Species),
selected = unique(iris$Species), multiple = TRUE),
actionButton("show", "Show")
),
mainPanel(
)
)
))
server <- shinyServer(function(input, output, session) {
output$mytabs <- renderUI({
nTabs <- length(input$decision)
# create tabPanel with datatable in it
myTabs <- lapply(seq_len(nTabs), function(i) {
verticalTabPanel(paste0("dataset_", input$decision[i]),
tableOutput(paste0("datatable_",i))
)
})
do.call(verticalTabsetPanel, myTabs)
})
observeEvent(input$show, {
showModal(modalDialog("modalExample",
"myTitle",
size = 'xl',
uiOutput('mytabs'),
easyClose = TRUE
))
})
# create datatables in popup ?
observe(
lapply(seq_len(length(input$decision)), function(i) {
output[[paste0("datatable_",i)]] <- renderTable({
as.data.frame(iris[iris$Species == input$decision[i], ])
})
})
)
})
shinyApp(ui, server)
When I try to use the Vertical Tabset in addition to using Bootstrap5, the content of the tab shows up below the tab buttons vice to thg right as expected.
Versions
ShinyWidgets: 0.7.5
Shiny: 1.7.2
bslib: 0.4.1
R: 4.2.0
Example Code