fresh (version 0.1.0)

bs_vars_modal: Bootstrap CSS modal variables

Description

Those variables can be used to customize modal (e.g. shiny::modalDialog in Bootstrap and Bootswatch themes.

Usage

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)

Arguments

md

Size in pixel for medium modal, e.g. modalDialog(size = "m").

lg

Size in pixel for large modal, e.g. modalDialog(size = "l").

sm

Size in pixel for small modal, e.g. modalDialog(size = "s").

inner_padding

Padding applied to the modal body.

title_padding

Padding applied to the modal title.

title_line_height

Modal title line-height.

content_bg

Background color of modal content area.

content_border_color

Modal content border color.

content_fallback_border_color

Modal content border color (for IE8).

backdrop_bg

Modal backdrop background color.

backdrop_opacity

Modal backdrop opacity.

header_border_color

Modal header border color.

footer_border_color

Modal footer border color.

Value

a list that can be used in create_theme.

Examples

Run this code
# NOT RUN {
bs_vars_modal(
  md = "80%",
  backdrop_opacity = 1,
  header_border_color = "#112446",
  footer_border_color = "#112446"
)

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)
}
# }

Run the code above in your browser using DataCamp Workspace