dashboardPage: Create a Boostrap 4 dashboard page

bs4DashPageR Documentation

Create a Boostrap 4 dashboard page

Description

Build an adminLTE3 dashboard page

Usage

bs4DashPage(
  header,
  sidebar,
  body,
  controlbar = NULL,
  footer = NULL,
  title = NULL,
  skin = NULL,
  freshTheme = NULL,
  preloader = NULL,
  options = NULL,
  fullscreen = FALSE,
  help = FALSE,
  dark = FALSE,
  scrollToTop = FALSE
)

dashboardPage(
  header,
  sidebar,
  body,
  controlbar = NULL,
  footer = NULL,
  title = NULL,
  skin = NULL,
  freshTheme = NULL,
  preloader = NULL,
  options = NULL,
  fullscreen = FALSE,
  help = FALSE,
  dark = FALSE,
  scrollToTop = FALSE
)

Arguments

header

Slot for bs4DashNavbar.

sidebar

Slot for bs4DashSidebar.

body

Slot for bs4DashBody.

controlbar

Slot for bs4DashControlbar (right side).

footer

Slot for bs4DashFooter.

title

App title.

skin

Deprecated skin parameters. See skinSelector for live theming.

freshTheme

A skin powered by the fresh package. Not compatible with skin. See https://dreamrs.github.io/fresh/articles/vars-shinydashboard.html.

preloader

bs4Dash uses waiter (see https://waiter.john-coene.com/#/). Pass a list like list(html = spin_1(), color = "#333e48") to configure waiterShowOnLoad (refer to the package help for all styles).

options

Extra option to overwrite the vanilla AdminLTE configuration. See https://adminlte.io/themes/AdminLTE/documentation/index.html#adminlte-options. Expect a list.

fullscreen

Whether to allow fullscreen feature in the navbar. Default to FALSE.

help

Whether to enable/disable popovers and tooltips. This allows to seamlessly use tooltip and popover without having to individually toggle them. Default to FALSE. if TRUE, a help icon is display in the navigation bar.

dark

Whether to display toggle to switch between dark and light mode in the dashboardHeader. Default to FALSE, app starts in light mode, with possibility to switch to dark. If TRUE, the app starts in dark with possibility to switch back to light. If NULL, not toggle is shown and the app starts in light, as it has always been.

scrollToTop

Whether to display a scroll to top button whenever the page height is too large. Default to FALSE.

Author(s)

David Granjon, dgranjon@ymail.com

Examples

if (interactive()) {
  library(shiny)
  library(bs4Dash)
  library(fresh)

  shinyApp(
    ui = dashboardPage(
      freshTheme = create_theme(
        bs4dash_vars(
          navbar_light_color = "#bec5cb",
          navbar_light_active_color = "#FFF",
          navbar_light_hover_color = "#FFF"
        ),
        bs4dash_yiq(
          contrasted_threshold = 10,
          text_dark = "#FFF",
          text_light = "#272c30"
        ),
        bs4dash_layout(
          main_bg = "#353c42"
        ),
        bs4dash_sidebar_light(
          bg = "#272c30",
          color = "#bec5cb",
          hover_color = "#FFF",
          submenu_bg = "#272c30",
          submenu_color = "#FFF",
          submenu_hover_color = "#FFF"
        ),
        bs4dash_status(
          primary = "#5E81AC", danger = "#BF616A", light = "#272c30"
        ),
        bs4dash_color(
          gray_900 = "#FFF", white = "#272c30"
        )
      ),
      options = NULL,
      header = dashboardHeader(
        title = dashboardBrand(
          title = "My dashboard",
          color = "primary",
          href = "https://adminlte.io/themes/v3",
          image = "https://adminlte.io/themes/v3/dist/img/AdminLTELogo.png"
        )
      ),
      sidebar = dashboardSidebar(),
      body = dashboardBody(
        box(status = "danger"),
        box(status = "primary"),
        box(status = "orange")
      ),
      controlbar = dashboardControlbar(),
      title = "DashboardPage"
    ),
    server = function(input, output) { }
  )
}

bs4Dash documentation built on May 5, 2022, 5:07 p.m.