Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bs_vars_alert

Bootstrap alert variables


Description

Those variables can be used to customize inputs in Bootstrap and Bootswatch themes.

Usage

bs_vars_alert(
  padding = NULL,
  border_radius = NULL,
  link_font_weight = NULL,
  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

padding

Padding for alerts.

border_radius

Border radius (rounded corners)

link_font_weight

Font weight for links in alerts.

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

bs_vars_alert(
  border_radius = "10px", # increase border radius,
  success_bg = "#c9d175" # change color for success alerts
)

if (interactive()) {
  library(shiny)

  ui <- fluidPage(
    use_theme(
      create_theme(
        theme = "default",
        bs_vars_alert(
          border_radius = "15px",
          success_bg = "forestgreen",
          success_text = "#FFF",
          danger_bg = "firebrick",
          danger_text = "#FFF"
        ),
        output_file = NULL
      )
    ),
    tags$br(),
    tags$div(
      class = "alert alert-success",
      "This is an alert !"
    ),
    tags$div(
      class = "alert alert-danger",
      "This is an other alert !"
    )
  )

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

  }

  shinyApp(ui, server)
}

fresh

Create Custom 'Bootstrap' Themes to Use in 'Shiny'

v0.2.0
GPL-3
Authors
Victor Perrier [aut, cre, cph], Fanny Meyer [aut], Thomas Park [ctb, cph] (Bootswatch themes), Mark Otto [ctb] (Bootstrap library), Jacob Thornton [ctb] (Bootstrap library), Bootstrap contributors [ctb] (Bootstrap library), Twitter, Inc [cph] (Bootstrap library), onkbear [ctb, cph] (admin-lte-2-sass), Colorlib [ctb, cph] (AdminLTE)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.