bs_vars_color {fresh} | R Documentation |
Bootstrap colors variables
Description
Those variables can be used to customize defaults colors in Bootstrap and Bootswatch themes.
Usage
bs_vars_color(
brand_primary = NULL,
brand_success = NULL,
brand_info = NULL,
brand_warning = NULL,
brand_danger = NULL,
gray_base = NULL,
gray_darker = NULL,
gray_dark = NULL,
gray = NULL,
gray_light = NULL,
gray_lighter = NULL
)
Arguments
brand_primary |
Primary color, default: #337ab7. |
brand_success |
Success color, default: #5cb85c. |
brand_info |
Info color, default: #5bc0de. |
brand_warning |
Warning color, default: #f0ad4e. |
brand_danger |
Danger color, default: #d9534f. |
gray_base |
Base gray color. |
gray_darker |
Darker gray color. |
gray_dark |
Dark gray color. |
gray |
Gray color. |
gray_light |
Light gray color. |
gray_lighter |
Lighter gray 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
# New colors (for buttons for example)
bs_vars_color(
brand_primary = "#75b8d1",
brand_success = "#c9d175",
brand_info = "#758bd1",
brand_warning = "#d1ab75",
brand_danger = "#d175b8"
)
if (interactive()) {
library(shiny)
library(shinyWidgets)
library(fresh)
ui <- fluidPage(
use_theme(create_theme(
theme = "default",
bs_vars_color(
brand_primary = "#75b8d1",
brand_success = "#c9d175",
brand_info = "#758bd1",
brand_warning = "#d1ab75",
brand_danger = "#d175b8"
)
)),
tags$h1("Colors"),
tags$p("Apply to :"),
tags$p("buttons"),
actionButton("btn1", "Primary", class = "btn-primary"),
actionButton("btn2", "Success", class = "btn-success"),
actionButton("btn3", "Danger", class = "btn-danger"),
actionButton("btn4", "Warning", class = "btn-warning"),
actionButton("btn5", "info", class = "btn-info"),
tags$br(), tags$br(),
tags$p("links"),
tags$a(href = "", "A link (same color as the primary button)"),
tags$br(), tags$br(),
tags$p("labels"),
tags$span(class = "label label-primary", "Primary"),
tags$span(class = "label label-success", "Success"),
tags$span(class = "label label-danger", "Danger"),
tags$span(class = "label label-warning", "Warning"),
tags$span(class = "label label-info", "Info"),
tags$br(), tags$br(),
tags$p("progress bars"),
progressBar(
"pb1", value = 80, status = "primary", display_pct = TRUE
),
progressBar(
"pb2", value = 80, status = "success", display_pct = TRUE
),
progressBar(
"pb3", value = 80, status = "danger", display_pct = TRUE
),
progressBar(
"pb4", value = 80, status = "warning", display_pct = TRUE
),
progressBar(
"pb5", value = 80, status = "info", display_pct = TRUE
),
tags$br(), tags$br(),
tags$p("and panels (only primary)"),
panel(
heading = "Primary panel",
status = "primary",
"For other status, look at ?bs_vars_state"
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
}
[Package fresh version 0.2.0 Index]