Skip to contents

A page wrapper that attaches the shadshiny asset bundle and establishes a .shad-scope root. Built on bslib::page_fillable() when bslib is installed, otherwise on shiny::fluidPage(). Dark mode follows bslib::input_dark_mode() automatically because the assets key off both .dark and [data-bs-theme="dark"].

Usage

page_shad(
  ...,
  title = NULL,
  theme_preset = NULL,
  dark = NULL,
  theme = NULL,
  lang = "en"
)

Arguments

...

UI elements, or named HTML attributes for the scope container.

title

Page title (browser tab).

theme_preset

NULL (the default neutral theme) or one of the colour presets: the full neutral ramps "slate", "stone", "zinc", "mauve", "olive", "mist", "taupe", or the accents "blue", "green", "rose", "violet", "orange". Sets data-shad-theme on the scope container.

dark

NULL to follow bslib/OS, TRUE to force dark, FALSE to force light.

theme

An optional custom shad_theme() applied page-wide (layered over theme_preset when both are given).

lang

Document language attribute.

Value

A page UI object.

See also

Other shadshiny page & theming: shad_theme_preset(), update_shad_theme()

Examples

if (interactive()) {
  shiny::shinyApp(
    page_shad(shad_badge("Hello"), theme_preset = "blue"),
    function(input, output, session) {}
  )
}