bslibdash is a toolkit for building modern dashboards in shiny. It sits on top of bslib and Bootstrap 5, and packages the building blocks of a typical dashboard — page shells, sidebars, cards, KPI tiles, header widgets and feedback components — behind a small, consistent API.
Because most of the components are a thin layer over bslib, dashboards built
with bslibdash share theming, dark mode and the wider Bootstrap 5
ecosystem (including teal
and other modern bslib-based Shiny modules) out of the box. The API also
mirrors shinydashboard wherever
the underlying concept is the same, so porting an existing app is
mostly search-and-replace — see vignette("getting-started") for the
full migration story.
library(shiny)
library(bslibdash)
ui <- dashboardPage(
header = dashboardHeader(title = "bslibdash demo"),
sidebar = dashboardSidebar(
sidebarUserPanel("Jane Doe", subtitle = "Administrator"),
sidebarMenu(
id = "sidebarMenu",
menuItem("Overview", tabName = "overview", icon = icon("house")),
menuItem("Reports", tabName = "reports", icon = icon("bar-chart"))
)
),
body = dashboardBody(
tabItems(
tabItem(
"overview",
boxLayout(
valueBox("128", "Open tickets", icon = icon("inbox"),
color = "primary"),
valueBox("42%", "CPU load", icon = icon("cpu"),
color = "warning"),
infoBox("Status", "Healthy", icon = icon("heart-pulse"),
color = "success")
),
box("Hello, world!", title = "Welcome",
status = "primary", collapsible = TRUE)
),
tabItem("reports", box("Report body", title = "Quarterly"))
)
)
)
shinyApp(ui, server = function(input, output, session) {})For a full walk-through of every component, run the kitchen-sink demo:
shiny::runApp(
system.file("shiny/examples/14_kitchen_sink", package = "bslibdash")
)- vs raw bslib — bslib gives you the building blocks (themes, cards, sidebars). bslibdash gives you the dashboard vocabulary on top: a page shell, a sidebar menu with sub-items and badges, header dropdowns, info/value tiles — so you don't write them in every app.
- vs shinydashboard —
same names, same mental model, but rendered with Bootstrap 5 and
themed through bslib. Dynamic theming, dark mode and
bs_themer()work out of the box. - vs bs4Dash — bslibdash stays close to vanilla bslib, so dashboards inherit your bslib theme rather than carrying a bespoke AdminLTE one.
- Fits the modern Shiny ecosystem. Because
bslibdash is a thin bslib layer, it slots into apps built with
teal, raw
bslib::page_*layouts, shinyuieditor, bsicons and any other Bootstrap 5 / bslib component — all sharing the same theme, dark mode andbs_themer()machinery as your dashboard shell.
At a glance, bslibdash covers the pieces a typical KPI dashboard needs:
- a responsive page shell (header, collapsible/overlay sidebar, body, footer),
- sidebar navigation with menus, sub-items, badges and a user panel,
- cards and tab-cards that can collapse, close and go full-screen,
- KPI tiles (value boxes, info boxes) on the Bootstrap status palette,
- header widgets for messages, notifications and tasks,
- feedback bits — accordions, badges, buttons, icons and toasts, and
- theming through any
bslib::bs_theme(), with components recompiling their CSS viabslib::bs_dependency_defer()so custom themes never drop bslibdash styles.
See vignette("components") or the package reference (?bslibdash) for
the live list of functions.
vignette("getting-started", package = "bslibdash")— minimal skeleton and the migration guide from shinydashboard.vignette("components", package = "bslibdash")— copy-pasteable tour of every component.vignette("theming", package = "bslibdash")— customisebrand_bs_theme(), swap Bootswatch presets, add bespoke SCSS, and usebslib::bs_themer().- Example apps live in
inst/shiny/examples/.
Please note that this project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.