bs_vars_button: Bootstrap button variables

Description Usage Arguments Value Examples

View source: R/vars-bootstrap.R

Description

Those variables can be used to customize buttons (e.g. shiny::actionButton) in Bootstrap and Bootswatch themes.

Usage

 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
bs_vars_button(
  font_weight = NULL,
  default_color = NULL,
  default_bg = NULL,
  default_border = NULL,
  primary_color = NULL,
  primary_bg = NULL,
  primary_border = NULL,
  success_color = NULL,
  success_bg = NULL,
  success_border = NULL,
  info_color = NULL,
  info_bg = NULL,
  info_border = NULL,
  warning_color = NULL,
  warning_bg = NULL,
  warning_border = NULL,
  danger_color = NULL,
  danger_bg = NULL,
  danger_border = NULL,
  link_disabled_color = NULL,
  border_radius_base = NULL,
  border_radius_large = NULL,
  border_radius_small = NULL
)

Arguments

font_weight

Text font weight.

default_color

Text color for default buttons.

default_bg

Background color for default buttons.

default_border

Border color for default buttons.

primary_color

Text color for primary buttons.

primary_bg

Background color for primary buttons.

primary_border

Border color for primary buttons.

success_color

Text color for success buttons.

success_bg

Background color for success buttons.

success_border

Border color for success buttons.

info_color

Text color for info buttons.

info_bg

Background color for info buttons.

info_border

Border color for info buttons.

warning_color

Text color for warning buttons.

warning_bg

Background color for warning buttons.

warning_border

Border color for warning buttons.

danger_color

Text color for danger buttons.

danger_bg

Background color for danger buttons.

danger_border

Border color for danger buttons.

link_disabled_color

Color for disabled link.

border_radius_base

Button rounded corner.

border_radius_large

Large button rounded corner.

border_radius_small

Small button rounded corner.

Value

a list that can be used in create_theme.

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
bs_vars_button(
  default_color = "#FFF",
  default_bg = "#112446",
  default_border = "#FFF",
  primary_color = "#112446",
  primary_bg = "#FFF",
  primary_border = "#112446",
  border_radius_base = 0
)

if (interactive()) {
  library(shiny)

  ui <- fluidPage(
    use_theme(
      create_theme(
        theme = "default",
        bs_vars_button(
          default_color = "#FFF",
          default_bg = "#112446",
          default_border = "#FFF",
          primary_color = "#112446",
          primary_bg = "#FFF",
          primary_border = "#112446",
          border_radius_base = 0
        ),
        output_file = NULL
      )
    ),
    tags$h1("Custom buttons"),
    actionButton("button1", "This is a default button"),
    actionButton(
      "button2", "This is a primary button",
      class = "btn-primary"
    )
  )

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

  }

  shinyApp(ui, server)
}

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