Skip to contents

glassPage() is a small convenience wrapper around bslib::page_fillable(). It adds useGlassTabs() automatically and uses a Bootstrap 5 theme by default. The function is experimental: its arguments may change during the 0.4.x development cycle as it is used in more apps.

Usage

glassPage(
  ...,
  title = NULL,
  lang = "en",
  theme = NULL,
  padding = NULL,
  gap = NULL,
  fillable_mobile = FALSE
)

Arguments

...

UI elements placed on the page.

title

Optional browser-window title.

lang

Language of the page content, such as "en" or "en-GB". This becomes the lang attribute on the page's <html> element.

theme

A bslib::bs_theme() object. When NULL, a Bootstrap 5 theme is created for the page.

padding

Optional page padding passed to bslib::page_fillable().

gap

Optional spacing between page children passed to bslib::page_fillable().

fillable_mobile

Whether the page should use fillable sizing on mobile browsers as well as desktop browsers.

Value

A fillable Bootstrap 5 page containing the glasstabs dependency.

Examples

if (interactive() && requireNamespace("bslib", quietly = TRUE)) {
  library(shiny)

  ui <- glassPage(
    title = "Team review",
    glassTabsUI(
      "review",
      glassTabPanel("queue", "Queue", p("Work waiting for review")),
      glassTabPanel("done", "Done", p("Completed work")),
      theme = "auto"
    )
  )

  shinyApp(ui, function(input, output, session) {})
}