use_theme: Use a CSS theme in Shiny application

Description Usage Arguments Value Examples

View source: R/use_theme.R

Description

Use a CSS theme in Shiny application

Usage

1
use_theme(theme)

Arguments

theme

Either a path to CSS file (if in www/ folder, do not include www/ in path), or a theme generated with create_theme and argument output_file = NULL.

Value

HTML tags to be included in a UI definition.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
if (interactive()) {
  library(shiny)
  library(fresh)

  ui <- fluidPage(
    use_theme(create_theme(
      theme = "default",
      bs_vars_global(
        body_bg = "#000",
        text_color = "#FFF"
      ),
      bs_vars_wells(
        bg = "#2E2E2E"
      )
    )),
    tags$h1("Inversed color theme"),

    sidebarLayout(
      sidebarPanel(
        "This is the sidebar panel"
      ),
      mainPanel(
        tags$h1("First level title"),
        tags$h2("Second level title"),
        tags$h3("Third level title"),
        tags$h4("Fourth level title"),
        tags$h5("Fifth level title"),
        tags$h6("Sixth level title")
      )
    )
  )

  server <- function(input, output, session) {

  }

  shinyApp(ui, server)
}

Example output



fresh documentation built on July 2, 2020, 1:59 a.m.