bs_vars_state: Bootstrap states variables

Description Usage Arguments Value Note Examples

View source: R/vars-bootstrap.R

Description

Those variables can be used to customize states colors (used for alerts or panels) in Bootstrap and Bootswatch themes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
bs_vars_state(
  success_text = NULL,
  success_bg = NULL,
  success_border = NULL,
  info_text = NULL,
  info_bg = NULL,
  info_border = NULL,
  warning_text = NULL,
  warning_bg = NULL,
  warning_border = NULL,
  danger_text = NULL,
  danger_bg = NULL,
  danger_border = NULL
)

Arguments

success_text

Success text color.

success_bg

Success background color.

success_border

Success border color.

info_text

Info text color.

info_bg

Info background color.

info_border

Info border color.

warning_text

Warning text color.

warning_bg

Warning background color.

warning_border

Warning border color.

danger_text

Danger text color.

danger_bg

Danger background color.

danger_border

Danger border color.

Value

a list that can be used in create_theme.

Note

See default parameters for Bootstrap: https://getbootstrap.com/docs/3.4/customize/.

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
39
40
41
42
43
44
45
46
47
48
# Panels & alerts colors
bs_vars_state(
  success_text = "#FFF",
  success_bg = "#238B45",
  success_border = "#00441B"
)

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

  ui <- fluidPage(

    use_theme(create_theme(
      theme = "default",
      bs_vars_state(
        success_text = "#FFF",
        success_bg = "#238B45",
        success_border = "#00441B"
      )
    )),

    tags$h1("State variables"),
    fluidRow(
      column(
        width = 6,
        tags$div(
          class = "alert alert-success",
          tags$b("Alert!"), "this is an alert !"
        )
      ),
      column(
        width = 6,
        panel(
          status = "success",
          "This is a panel"
        )
      )
    )
  )

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

  }

  shinyApp(ui, server)
}

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