use_dca: Use DCA Modules

View source: R/use_dca.R

use_dcaR Documentation

Use DCA Modules

Description

Initiate dca modules dependencies

Usage

use_dca(theme = "default")

Arguments

theme

The theme of app. A list variables, e.g. list('header-bg-cl' = 'red'), a config file (.rds) or a prefined theme ("sage") is accepted. Default is the "default" theme.

Examples

if (interactive()) {
  library(shinydashboard)
  library(dcamodules)
  # 1. use it in the dashboardBody()
  dashboardBody(
    use_dca(theme = "sage")
  )

  # 2. create your own custom variables
  custom_theme <- list(
    "primary" = "blue",
    "accent" = "red",
    "dark" = NULL,
    "light" = NULL,
    "success" = NULL,
    "info" = NULL,
    "warning" = NULL,
    "danger" = NULL,
    "white" = NULL,
    "black" = NULL,
    "font" = NULL,
    "link-font-cl" = NULL,
    "content-bg-cl" = NULL,
    "content-font-cl" = NULL,
    "header-bg-cl" = NULL,
    "header-font-cl" = NULL,
    "sidebar-bg-cl" = NULL,
    "sidebar-font-cl" = NULL,
    "sidebar-bg-select-cl" = NULL,
    "sidebar-font-select-cl" = NULL,
    "sidebar-bg-hover-cl" = NULL,
    "sidebar-font-hover-cl" = NULL,
    "footer-bg-cl" = NULL,
    "footer-font-cl" = NULL,
    "waiter-bg-cl" = NULL,
    "waiter-font-cl" = NULL
  )
  # save variables to rds
  saveRDS(custom_theme, "theme_config.rds")

  # set them by parsing the config rds
  dashboardBody(
    use_dca(theme = "theme_config.rds")
  )
}

Sage-Bionetworks/dcamodules documentation built on Jan. 26, 2023, 1:15 a.m.