Those variables can be used to customize
modal (e.g. shiny::modalDialog
in Bootstrap and Bootswatch themes.
bs_vars_modal(
md = NULL,
lg = NULL,
sm = NULL,
inner_padding = NULL,
title_padding = NULL,
title_line_height = NULL,
content_bg = NULL,
content_border_color = NULL,
content_fallback_border_color = NULL,
backdrop_bg = NULL,
backdrop_opacity = NULL,
header_border_color = NULL,
footer_border_color = NULL
)
Size in pixel for medium modal, e.g. modalDialog(size = "m")
.
Size in pixel for large modal, e.g. modalDialog(size = "l")
.
Size in pixel for small modal, e.g. modalDialog(size = "s")
.
Padding applied to the modal body.
Padding applied to the modal title.
Modal title line-height.
Background color of modal content area.
Modal content border color.
Modal content border color (for IE8).
Modal backdrop background color.
Modal backdrop opacity.
Modal header border color.
Modal footer border color.
a list
that can be used in create_theme
.
bs_vars_modal(
md = "80%",
backdrop_opacity = 1,
header_border_color = "#112446",
footer_border_color = "#112446"
)
#> $`modal-md`
#> [1] "80%"
#>
#> $`modal-backdrop-opacity`
#> [1] 1
#>
#> $`modal-header-border-color`
#> [1] "#112446"
#>
#> $`modal-footer-border-color`
#> [1] "#112446"
#>
#> attr(,"class")
#> [1] "fresh_sass_vars" "bootstrap_vars" "list"
if (interactive()) {
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
use_theme(
create_theme(
theme = "default",
bs_vars_modal(
md = "80%",
backdrop_opacity = 1,
header_border_color = "#112446",
footer_border_color = "#112446"
),
output_file = NULL
)
),
tags$h1("Custom modals"),
actionButton("show", "Show modal dialog")
)
server <- function(input, output, session) {
observeEvent(input$show, {
showModal(modalDialog(
title = "Important message",
"This is an important message!"
))
})
}
shinyApp(ui, server)
}