| Title: | Branding, Theme Application and Navigation Utilities for 'bs4Dash' Dashboards |
|---|---|
| Description: | Provides branding, theme application, and navigation utilities for applications built with 'bs4Dash' and 'shiny'. Supports configurable sidebar brand display modes, hover-expand behavior, and theme customization using CSS variables. Includes standardized navigation components such as refresh and help controls, along with helpers for common navigation bar and footer layouts. |
| Authors: | George Arthur [aut, cre] |
| Maintainer: | George Arthur <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-06-01 21:06:50 UTC |
| Source: | https://github.com/prigasg/bs4dashkit |
Returns a richer runnable shiny.appobj for testing sidebar brand states,
hover-expand behavior, theme presets, navbar controls, and footer styling in
one place.
bs4dashkit_demo_app()bs4dashkit_demo_app()
A shiny.appobj.
Returns a tiny runnable shiny.appobj that demonstrates the recommended
dash_titles() plus use_bs4Dashkit_core() flow.
bs4dashkit_example_app()bs4dashkit_example_app()
A shiny.appobj.
Returns the theme presets shipped with bs4Dashkit so they are easy to discover in code completion, validation errors, and documentation.
bs4dashkit_theme_presets(values = FALSE)bs4dashkit_theme_presets(values = FALSE)
values |
Logical. If |
A data frame with one row per preset and columns preset and
description. If values = TRUE, the returned data frame also includes a
tokens list-column.
Produces an icon + text block for bs4Dash brand slots with rich styling and optional visual effects. Supports Font Awesome icons or image logos.
dash_brand_ui( brand_text, icon = NULL, icon_img = NULL, icon_shape = c("circle", "rounded", "square"), icon_size = NULL, icon_color = NULL, weight = 700, spacing = "-0.02em", size = NULL, italic = FALSE, font_family = NULL, color = NULL, gradient = NULL, effect = c("none", "glow", "shimmer", "emboss"), glow_color = NULL )dash_brand_ui( brand_text, icon = NULL, icon_img = NULL, icon_shape = c("circle", "rounded", "square"), icon_size = NULL, icon_color = NULL, weight = 700, spacing = "-0.02em", size = NULL, italic = FALSE, font_family = NULL, color = NULL, gradient = NULL, effect = c("none", "glow", "shimmer", "emboss"), glow_color = NULL )
brand_text |
Visible brand label (character). May be |
icon |
Font Awesome icon name e.g. "shield-halved", or a simple
|
icon_img |
URL or www-relative path to an image logo. Overrides |
icon_shape |
Shape mask for image icons: "circle", "rounded", "square". Ignored for FA icons. Default "circle". |
icon_size |
Size of icon/image as CSS string e.g. "20px", "1.3em". NULL = inherits sidebar default. |
icon_color |
CSS color for FA icon e.g. "#2f6f8f". NULL = inherit. For image icons, applies a CSS tint via mix-blend-mode (subtle). |
weight |
CSS font-weight: numeric or keyword. Default 700. |
spacing |
CSS letter-spacing. Default "-0.02em". |
size |
CSS font-size for label e.g. "13px". NULL = inherit. |
italic |
Logical. Italicise the label. Default FALSE. |
font_family |
CSS font-family string e.g. "'Inter', sans-serif". |
color |
Solid CSS color for label text. NULL = inherit.
Ignored when |
gradient |
Character vector of 2 hex colors for gradient text effect e.g. c("#2f6f8f", "#5ba3c9"). Automatically enables effect = "gradient". |
effect |
Visual effect on label: "none", "glow", "shimmer", "emboss".
"gradient" is set automatically when |
glow_color |
CSS color for glow effect. Defaults to first gradient color
or |
A named list with components:
A shiny.tag.list containing the generated brand UI.
A shiny.tag object containing scoped CSS dependencies for the brand styling.
Single entry point for branding and sidebar brand behavior. Creates a
reusable object you place into bs4DashPage(), bs4DashNavbar(),
and bs4DashBody().
dash_titles( brand_text, app_name = NULL, icon = NULL, icon_img = NULL, icon_shape = c("circle", "rounded", "square"), icon_size = NULL, icon_color = NULL, weight = 700, spacing = "-0.02em", size = NULL, italic = FALSE, font_family = NULL, color = NULL, gradient = NULL, effect = c("none", "glow", "shimmer", "emboss"), glow_color = NULL, collapsed = NULL, expanded = NULL, collapsed_text = NULL, expanded_text = NULL, collapsed_text_size = NULL, expanded_text_size = NULL, collapsed_text_weight = NULL, expanded_text_weight = NULL, brand_divider = NULL, debug = NULL )dash_titles( brand_text, app_name = NULL, icon = NULL, icon_img = NULL, icon_shape = c("circle", "rounded", "square"), icon_size = NULL, icon_color = NULL, weight = 700, spacing = "-0.02em", size = NULL, italic = FALSE, font_family = NULL, color = NULL, gradient = NULL, effect = c("none", "glow", "shimmer", "emboss"), glow_color = NULL, collapsed = NULL, expanded = NULL, collapsed_text = NULL, expanded_text = NULL, collapsed_text_size = NULL, expanded_text_size = NULL, collapsed_text_weight = NULL, expanded_text_weight = NULL, brand_divider = NULL, debug = NULL )
brand_text |
Visible brand label shown in the navbar/sidebar. May be
|
app_name |
Browser tab title. If |
icon |
Font Awesome icon name for the brand (for example
|
icon_img |
Path (www relative) or URL to an image logo. Overrides |
icon_shape |
Shape mask for image logos. One of |
icon_size |
CSS size for the icon/image (e.g. |
icon_color |
CSS color for the Font Awesome icon. For image icons, a subtle tint may be applied. |
weight |
CSS font-weight for the brand text. |
spacing |
CSS letter-spacing for the brand text. |
size |
CSS font-size for the brand text (e.g. |
italic |
Logical. If |
font_family |
CSS font-family string (e.g. |
color |
Solid CSS text color for the brand label (ignored when |
gradient |
Character vector of length 2 giving gradient colors for the brand label. When set, gradient styling is applied. |
effect |
Visual effect for the brand label. One of |
glow_color |
Color used for glow/shimmer effects (when applicable). |
collapsed |
Sidebar brand mode when the sidebar is collapsed. One of
|
expanded |
Sidebar brand mode when the sidebar is expanded. One of
|
collapsed_text |
Short label used in collapsed mode (recommended <= 8 chars). |
expanded_text |
Label used in expanded mode (recommended <= 30 chars). |
collapsed_text_size |
Optional CSS font-size applied only to the sidebar
brand label while collapsed (for example |
expanded_text_size |
Optional CSS font-size applied only to the sidebar brand label while expanded. |
collapsed_text_weight |
Optional CSS font-weight applied only to the sidebar brand label while collapsed. |
expanded_text_weight |
Optional CSS font-weight applied only to the sidebar brand label while expanded. |
brand_divider |
Logical. If |
debug |
Logical. If |
A named list with components:
A character string for use in bs4DashPage(title = ...).
A shiny.tag object for use in bs4DashNavbar(title = ...). In a standard bs4DashPage(), the sidebar brand mirrors the navbar brand automatically.
A shiny.tag.list containing CSS and JavaScript dependencies to include once in bs4DashBody(...).
Adds the package's bundled CSS (core, theme, sidebar) and optional JS helpers.
use_bs4Dashkit(include_center_js = TRUE)use_bs4Dashkit(include_center_js = TRUE)
include_center_js |
Logical. If |
A htmltools::tagList containing an htmltools::htmlDependency
for the package CSS and optional JavaScript helpers.
Recommended entry point for bs4Dashkit in bs4DashBody().
For most apps, this should be the first element inside bs4DashBody(...).
use_bs4Dashkit_core( ttl, preset = NULL, accent = NULL, ..., topbar_h = 56, collapsed_w = 4.2, expanded_w = 250 )use_bs4Dashkit_core( ttl, preset = NULL, accent = NULL, ..., topbar_h = 56, collapsed_w = 4.2, expanded_w = 250 )
ttl |
Output from dash_titles() |
preset |
Optional theme preset name (e.g. "professional"). If NULL, uses option bs4Dashkit.theme_preset (if set). |
accent |
Optional accent override. If NULL, uses option bs4Dashkit.accent. If preset is used, this overrides the preset accent. |
... |
Optional overrides passed to use_dash_theme_preset() when preset is used. |
topbar_h |
Height (px) for topbar + brand strip |
collapsed_w |
Sidebar collapsed width (rem) |
expanded_w |
Sidebar expanded width (px) |
A shiny.tag.list containing core CSS and/or JavaScript dependencies for bs4Dashkit.
Sidebar behavior: icon-only collapse + hover expand + ellipsis labels
use_dash_sidebar_behavior(topbar_h = 56, collapsed_w = 4.2, expanded_w = 250)use_dash_sidebar_behavior(topbar_h = 56, collapsed_w = 4.2, expanded_w = 250)
topbar_h |
Height in px for navbar and sidebar brand strip |
collapsed_w |
Width for icon-only sidebar (rem) |
expanded_w |
Expanded sidebar width (px) |
A shiny.tag or shiny.tag.list containing sidebar behavior dependencies to include in the UI.
Toggle the sidebar header divider (line under the brand area)
use_dash_sidebar_brand_divider(show = TRUE)use_dash_sidebar_brand_divider(show = TRUE)
show |
Logical. TRUE keeps divider (default). FALSE hides it. |
If show is TRUE, an empty shiny.tag.list. If
show is FALSE, a shiny.tag object containing CSS that
hides the sidebar brand divider.
Controls icon visibility, text visibility, and text content in both collapsed and expanded sidebar states.
use_dash_sidebar_brand_mode( icon = NULL, collapsed = c("icon-only", "icon-text", "text-only"), expanded = c("icon-text", "icon-only", "text-only"), collapsed_text = NULL, expanded_text = NULL, collapsed_text_size = NULL, expanded_text_size = NULL, collapsed_text_weight = NULL, expanded_text_weight = NULL, debug = FALSE )use_dash_sidebar_brand_mode( icon = NULL, collapsed = c("icon-only", "icon-text", "text-only"), expanded = c("icon-text", "icon-only", "text-only"), collapsed_text = NULL, expanded_text = NULL, collapsed_text_size = NULL, expanded_text_size = NULL, collapsed_text_weight = NULL, expanded_text_weight = NULL, debug = FALSE )
icon |
Font Awesome icon name used in the brand, e.g. "shield-halved",
or a simple |
collapsed |
Display mode when sidebar is collapsed: "icon-only", "icon-text", or "text-only" |
expanded |
Display mode when sidebar is expanded: "icon-text", "icon-only", or "text-only" |
collapsed_text |
Short label for collapsed "icon-text" or "text-only" mode.
Keep <= 8 chars. NULL falls back to the current brand label already present in
the DOM. When using |
expanded_text |
Label for expanded "icon-text" or "text-only" mode.
Keep <= 30 chars. NULL falls back to the current brand label already present
in the DOM. When using |
collapsed_text_size |
Optional CSS font-size applied to the sidebar brand label while collapsed. |
expanded_text_size |
Optional CSS font-size applied to the sidebar brand label while expanded. |
collapsed_text_weight |
Optional CSS font-weight applied to the sidebar brand label while collapsed. |
expanded_text_weight |
Optional CSS font-weight applied to the sidebar brand label while expanded. |
debug |
Logical. If |
Modes:
"icon-only" : icon shown, label hidden — requires icon
"text-only" : label shown, icon hidden — collapsed_text / expanded_text optional
"icon-text" : both shown — requires icon; text args optional
A shiny.tag or shiny.tag.list containing sidebar brand mode styling or dependencies.
Sets bs4Dashkit CSS custom properties (variables) for background, surfaces, borders, text, and accent color.
use_dash_theme( bg = "#f5f6f8", surface = "#ffffff", border = "#e2e3e7", text = "#1d1f23", muted = "#6b6f76", accent = "#2f6f8f", accent_soft = "#e8f1f5", navbar_bg = "#ffffff", navbar_text = "#1d1f23", sidebar_bg = "#ffffff", sidebar_text = "#1d1f23", sidebar_hover = "#eef4f7", footer_bg = "#ffffff", footer_text = "#6b6f76", success = "#2d8a56", warning = "#c37a14", danger = "#b94a48", radius = 12, shadow = "0 1px 3px rgba(0,0,0,0.07)" )use_dash_theme( bg = "#f5f6f8", surface = "#ffffff", border = "#e2e3e7", text = "#1d1f23", muted = "#6b6f76", accent = "#2f6f8f", accent_soft = "#e8f1f5", navbar_bg = "#ffffff", navbar_text = "#1d1f23", sidebar_bg = "#ffffff", sidebar_text = "#1d1f23", sidebar_hover = "#eef4f7", footer_bg = "#ffffff", footer_text = "#6b6f76", success = "#2d8a56", warning = "#c37a14", danger = "#b94a48", radius = 12, shadow = "0 1px 3px rgba(0,0,0,0.07)" )
bg |
Page background color. |
surface |
Card and panel background color. |
border |
Border color used on cards, separators, and outlines. |
text |
Primary text color. |
muted |
Muted text color. |
accent |
Accent color used for highlights and emphasis. |
accent_soft |
Softer accent tone used for subtle fills, hover states, and focus treatments. |
navbar_bg |
Navbar background color. |
navbar_text |
Navbar text color. |
sidebar_bg |
Sidebar background color. |
sidebar_text |
Sidebar text color. |
sidebar_hover |
Sidebar hover and active background color. |
footer_bg |
Footer background color. |
footer_text |
Footer text color. |
success |
Success accent color. |
warning |
Warning accent color. |
danger |
Danger accent color. |
radius |
Corner radius in pixels. |
shadow |
Box shadow CSS string used for cards and surfaces. |
A shiny.tag.list containing stylesheet dependencies and inline CSS variables for the app theme.
Apply a theme preset
use_dash_theme_preset(preset = c("professional", "modern", "dark-lite"), ...)use_dash_theme_preset(preset = c("professional", "modern", "dark-lite"), ...)
preset |
One of: "professional", "modern", "dark-lite" |
... |
Passed to use_dash_theme() to override preset values |
A shiny.tag or shiny.tag.list containing theme preset CSS and related UI dependencies.