rstudio / rstudio/bslib

Unexpected fill-ability differences between navset_tab and navset_bar

Open
#1,335 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ai-triage:done Priority: Medium
Dominant language
SCSS
Stars
569
Forks
72
Avg merge
1d 2h
Merged PRs (30d)
5

Description

Describe the problem

I was trying to get my tables inside navset_tab panels to fill the containers, but they will not.

After some trial and error, I find that navset_bar panels behave differently and in a more expected fashion.

I created this vignette to show the difference. You can see the "big table" tab of the "navset_tab test" is the one that has unexpected behavior - its DT table only fills half the card.

Apologies if this is expected behavior and is a result of my misunderstanding. I have the impression that the tabs and bars are meant to be visual differences and that the intended behavior of bootstrap cards is to fill their contents.

Thanks for the great package!


# dependencies  ----

library(tidyverse)
library(shiny)
library(bslib)
library(DT)


# functions ----

# forgive the overloading
datatable <- function(data, options = list(paging = FALSE, scrollY = "100%", dom = "t"), ...) {
  data |> 
    DT::datatable(
      rownames = FALSE,
      fillContainer = TRUE, # important; allows frozen header
      options = options,
      ...
    ) 
}


# data ----

dat <- mtcars |> 
  as_tibble() |> 
  list() |> 
  rep(5) |> 
  list_rbind()


# user interface ----

ui <- page_navbar(
  nav_panel(
    "navset_bar test",
    card(
      navset_bar(
        nav_panel("small table", DTOutput("small_table_for_bar")),
        nav_panel("big table", textOutput("message_bar"), DTOutput("big_table_for_bar"))
      )
    )
  ),
  nav_panel(
    "navset_tab test",
    card(
      navset_tab(
        nav_panel("small table", DTOutput("small_table_for_tab")),
        nav_panel("big table", textOutput("message_tab"), DTOutput("big_table_for_tab"))
      )
    )
  )
)


# server ----

server <- function(input, output, session) {
  
  output$small_table_for_bar <- renderDT(datatable(dat[1:5, ]))
  output$big_table_for_bar <- renderDT(datatable(dat))
  output$message_bar <- renderText("the contents fill the card")
  
  output$small_table_for_tab <- renderDT(datatable(dat[1:5, ]))
  output$big_table_for_tab <- renderDT(datatable(dat))
  output$message_tab <- renderText("the contents no NOT fill the card")
  
}


# launch ---

shinyApp(ui = ui, server = server)
Session Info
> devtools::session_info()
─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.5.3 (2026-03-11 ucrt)
 os       Windows 11 x64 (build 26200)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  English_United States.utf8
 ctype    English_United States.utf8
 tz       America/New_York
 date     2026-07-15
 rstudio  2026.04.0+526 Globemaster Allium (desktop)
 pandoc   NA
 quarto   ERROR: Unknown command "TMPDIR=C:/Users/st2516/AppData/Local/Temp/RtmpeUFV7e/file40dcdcb2996". Did you mean command "install"? @ C:\\PROGRA~1\\Quarto\\bin\\quarto.exe

─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package      * version    date (UTC) lib source
 bit            4.6.0      2025-03-06 [1] CRAN (R 4.5.3)
 bit64          4.8.0      2026-04-21 [1] CRAN (R 4.5.3)
 blend        * 0.0.0.9000 2026-07-13 [1] local
 blob           1.3.0      2026-01-14 [1] CRAN (R 4.5.3)
 bsicons        0.1.2      2023-11-04 [1] CRAN (R 4.5.3)
 bslib        * 0.10.0     2026-01-26 [1] CRAN (R 4.5.3)
 cachem         1.1.0      2024-05-16 [1] CRAN (R 4.5.3)
 cellranger     1.1.0      2016-07-27 [1] CRAN (R 4.5.3)
 cli            3.6.6      2026-04-09 [1] CRAN (R 4.5.3)
 crayon         1.5.3      2024-06-20 [1] CRAN (R 4.5.3)
 crosstalk      1.2.2      2025-08-26 [1] CRAN (R 4.5.3)
 DBI          * 1.3.0      2026-02-25 [1] CRAN (R 4.5.3)
 dbplyr       * 2.5.2      2026-02-13 [1] CRAN (R 4.5.3)
 devtools       2.5.2      2026-04-30 [1] CRAN (R 4.5.3)
 digest         0.6.39     2025-11-19 [1] CRAN (R 4.5.3)
 dplyr        * 1.2.1      2026-04-03 [1] CRAN (R 4.5.3)
 DT           * 0.34.0     2025-09-02 [1] CRAN (R 4.5.3)
 duckdb       * 1.5.2      2026-04-13 [1] CRAN (R 4.5.3)
 ellipsis       0.3.3      2026-04-04 [1] CRAN (R 4.5.3)
 farver         2.1.2      2024-05-13 [1] CRAN (R 4.5.3)
 fastmap        1.2.0      2024-05-15 [1] CRAN (R 4.5.3)
 fontawesome  * 0.5.3      2024-11-16 [1] CRAN (R 4.5.3)
 forcats      * 1.0.1      2025-09-25 [1] CRAN (R 4.5.3)
 fs             2.1.0      2026-04-18 [1] CRAN (R 4.5.3)
 generics       0.1.4      2025-05-09 [1] CRAN (R 4.5.3)
 ggplot2      * 4.0.3      2026-04-22 [1] CRAN (R 4.5.3)
 ggsci        * 5.0.0      2026-04-17 [1] CRAN (R 4.5.3)
 glue           1.8.1      2026-04-17 [1] CRAN (R 4.5.3)
 gtable         0.3.6      2024-10-25 [1] CRAN (R 4.5.3)
 hms            1.1.4      2025-10-17 [1] CRAN (R 4.5.3)
 htmltools    * 0.5.9      2025-12-04 [1] CRAN (R 4.5.3)
 htmlwidgets    1.6.4      2023-12-06 [1] CRAN (R 4.5.3)
 httpuv         1.6.17     2026-03-18 [1] CRAN (R 4.5.3)
 janitor      * 2.2.1      2024-12-22 [1] RSPM
 jquerylib      0.1.4      2021-04-26 [1] CRAN (R 4.5.3)
 jsonlite       2.0.0      2025-03-27 [1] CRAN (R 4.5.3)
 later          1.4.8      2026-03-05 [1] CRAN (R 4.5.3)
 lifecycle      1.0.5      2026-01-08 [1] CRAN (R 4.5.3)
 lpSolve        5.6.23     2024-12-14 [1] CRAN (R 4.5.2)
 lubridate    * 1.9.5      2026-02-04 [1] CRAN (R 4.5.3)
 magrittr       2.0.5      2026-04-04 [1] CRAN (R 4.5.3)
 memoise        2.0.1      2021-11-26 [1] CRAN (R 4.5.3)
 mime           0.13       2025-03-17 [1] CRAN (R 4.5.2)
 odbc         * 1.7.0      2026-05-09 [1] CRAN (R 4.5.3)
 otel           0.2.0      2025-08-29 [1] CRAN (R 4.5.3)
 pillar         1.11.1     2025-09-17 [1] CRAN (R 4.5.3)
 pkgbuild       1.4.8      2025-05-26 [1] CRAN (R 4.5.3)
 pkgconfig      2.0.3      2019-09-22 [1] CRAN (R 4.5.3)
 pkgload        1.5.2      2026-04-22 [1] CRAN (R 4.5.3)
 promises       1.5.0      2025-11-01 [1] CRAN (R 4.5.3)
 purrr        * 1.2.2      2026-04-10 [1] CRAN (R 4.5.3)
 R6             2.6.1      2025-02-15 [1] CRAN (R 4.5.3)
 RColorBrewer   1.1-3      2022-04-03 [1] CRAN (R 4.5.2)
 Rcpp           1.1.1-1.1  2026-04-24 [1] CRAN (R 4.5.3)
 reactable    * 0.4.5      2025-12-01 [1] CRAN (R 4.5.3)
 reactR         0.6.1      2024-09-14 [1] CRAN (R 4.5.3)
 readr        * 2.2.0      2026-02-19 [1] CRAN (R 4.5.3)
 readxl       * 1.4.5      2025-03-07 [1] CRAN (R 4.5.3)
 rlang          1.2.0      2026-04-06 [1] CRAN (R 4.5.3)
 rsconnect      1.10.0     2026-06-08 [1] CRAN (R 4.5.3)
 rstudioapi     0.18.0     2026-01-16 [1] CRAN (R 4.5.3)
 S7             0.2.2      2026-04-22 [1] CRAN (R 4.5.3)
 sass           0.4.10     2025-04-11 [1] CRAN (R 4.5.3)
 scales         1.4.0      2025-04-24 [1] CRAN (R 4.5.3)
 sessioninfo    1.2.3      2025-02-05 [1] CRAN (R 4.5.3)
 shiny        * 1.13.0     2026-02-20 [1] CRAN (R 4.5.3)
 snakecase      0.11.1     2023-08-27 [1] CRAN (R 4.5.3)
 sourcetools    0.1.7-2    2026-03-28 [1] CRAN (R 4.5.3)
 stringi        1.8.7      2025-03-27 [1] CRAN (R 4.5.2)
 stringr      * 1.6.0      2025-11-04 [1] CRAN (R 4.5.3)
 tibble       * 3.3.1      2026-01-11 [1] CRAN (R 4.5.3)
 tidyr        * 1.3.2      2025-12-19 [1] CRAN (R 4.5.3)
 tidyselect     1.2.1      2024-03-11 [1] CRAN (R 4.5.3)
 tidyverse    * 2.0.0      2023-02-22 [1] CRAN (R 4.5.3)
 timechange     0.4.0      2026-01-29 [1] CRAN (R 4.5.3)
 tzdb           0.5.0      2025-03-15 [1] CRAN (R 4.5.3)
 usethis        3.2.1      2025-09-06 [1] CRAN (R 4.5.3)
 utf8           1.2.6      2025-06-08 [1] CRAN (R 4.5.3)
 vctrs          0.7.3      2026-04-11 [1] CRAN (R 4.5.3)
 vroom          1.7.1      2026-03-31 [1] CRAN (R 4.5.3)
 withr          3.0.2      2024-10-28 [1] CRAN (R 4.5.3)
 writexl      * 1.5.4      2025-04-15 [1] CRAN (R 4.5.3)
 xtable         1.8-8      2026-02-22 [1] CRAN (R 4.5.3)
 yaml           2.3.12     2025-12-10 [1] CRAN (R 4.5.3)

 [1] C:/Users/st2516/AppData/Local/R/win-library/4.5
 [2] C:/Program Files/R/R-4.5.3/library
 * ── Packages attached to the search path.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied Shiny app and comparing the navset_tab and navset_bar table panels. Read the bslib navigation and card styling involved in their fill behavior; done means the DT table fills the card consistently in both examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
bootstrap, r, sass
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.