Description Usage Arguments Value Examples
View source: R/vars-bootstrap.R
Those variables can be used to customize
panel (e.g. shinyWidgets::panel
in Bootstrap and Bootswatch themes.
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 | bs_vars_panel(
bg = NULL,
body_padding = NULL,
heading_padding = NULL,
footer_padding = NULL,
border_radius = NULL,
inner_border = NULL,
footer_bg = NULL,
default_text = NULL,
default_border = NULL,
default_heading_bg = NULL,
primary_text = NULL,
primary_border = NULL,
primary_heading_bg = NULL,
success_text = NULL,
success_border = NULL,
success_heading_bg = NULL,
info_text = NULL,
info_border = NULL,
info_heading_bg = NULL,
warning_text = NULL,
warning_border = NULL,
warning_heading_bg = NULL,
danger_text = NULL,
danger_border = NULL,
danger_heading_bg = NULL
)
|
bg |
Background color. |
body_padding |
Panel body padding. |
heading_padding |
Panel heading padding. |
footer_padding |
Panel footer padding. |
border_radius |
Variable for setting rounded corners on panel. |
inner_border |
Border color for inner elements in panel. |
footer_bg |
Panel footer background color. |
default_text |
Default color for text. |
default_border |
Default border color. |
default_heading_bg |
Default background color for panel heading. |
primary_text |
Text color for primary status. |
primary_border |
Border color for primary status. |
primary_heading_bg |
Heading background color for primary status. |
success_text |
Text color for success status. |
success_border |
Border color for success status. |
success_heading_bg |
Heading background color for success status. |
info_text |
Text color for info status. |
info_border |
Border color for info status. |
info_heading_bg |
Heading background color for info status. |
warning_text |
Text color for warning status. |
warning_border |
Border color for warning status. |
warning_heading_bg |
Heading background color for warning status. |
danger_text |
Text color for danger status. |
danger_border |
Border color for danger status. |
danger_heading_bg |
Heading background color for danger status. |
a list
that can be used in create_theme
.
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | bs_vars_panel(
border_radius = "15px",
default_text = "#FFF",
default_heading_bg = "#3f2d54",
default_border = "#3f2d54",
primary_heading_bg = "#1B9E77",
primary_border = "#1B9E77",
success_heading_bg = "#D95F02",
success_border = "#D95F02",
success_text = "#FFF",
danger_heading_bg = "#7570B3",
danger_border = "#7570B3",
danger_text = "#FFF"
)
if (interactive()) {
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
use_theme(
create_theme(
theme = "default",
bs_vars_panel(
border_radius = "15px",
default_text = "#FFF",
default_heading_bg = "#3f2d54",
default_border = "#3f2d54",
primary_heading_bg = "#1B9E77",
primary_border = "#1B9E77",
success_heading_bg = "#D95F02",
success_border = "#D95F02",
success_text = "#FFF",
danger_heading_bg = "#7570B3",
danger_border = "#7570B3",
danger_text = "#FFF"
),
output_file = NULL
)
),
tags$h1("Custom panels"),
fluidRow(
column(
width = 3,
panel(
heading = "Default panel",
"Some content"
)
),
column(
width = 3,
panel(
heading = "Primary panel",
status = "primary",
"Some content"
)
),
column(
width = 3,
panel(
heading = "Success panel",
status = "success",
"Some content"
)
),
column(
width = 3,
panel(
heading = "Danger panel",
status = "danger",
"Some content"
)
)
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.