Dialog

Description

Create a modal dialog with a title, content, and actions.

Usage

bc_dialog(
  id,
  title = NULL,
  description = NULL,
  content = NULL,
  actions = NULL,
  ...,
  open = FALSE,
  close_on_click = TRUE
)

bc_dialog_close(label = "Close", ..., variant = "primary")

Arguments

Argument Description
id String. The dialog's ID, which bc_dialog_trigger() targets. With bc_shiny_deps(), input$id is TRUE while the dialog is open.
title String or tag. The dialog title.
description String or tag. Text under the title.
content Tag or tag list. The main content, which scrolls when tall.
actions Tag or tag list. Buttons at the bottom of the dialog.
... Extra tag attributes.
open Bool. Whether the dialog starts open. Defaults to FALSE.
close_on_click Bool. Whether a click outside the dialog closes it. Defaults to TRUE.
label String or tag. The button's label.
variant String. The button variant, as in bc_button(). Defaults to "primary".

Value

An htmltools tag.

Examples

bc_dialog_trigger("profile-dialog", class = "btn", "Edit profile")

bc_dialog(
  id = "profile-dialog",
  title = "Edit profile",
  description = "Make changes to your profile here.",
  content = bc_input(id = "name", label = "Name", value = "Pedro Duarte"),
  actions = htmltools::tagList(
    bc_dialog_close("Cancel", variant = "outline"),
    bc_dialog_close("Save changes")
  )
)

Edit profile

Make changes to your profile here.


bc_dialog_close("Cancel", variant = "outline")