Alert Dialog

Description

Create a modal dialog that asks the user to confirm or cancel.

Usage

bc_alert_dialog(
  ...,
  id = NULL,
  title = NULL,
  description = NULL,
  icon = NULL,
  cancel = "Cancel",
  confirm = "Continue",
  size = "default",
  open = FALSE,
  trigger = NULL
)

Arguments

Argument Description
... Extra tag attributes for the dialog.
id String. The dialog's ID. Defaults to a random ID. With bc_shiny_deps(), input$id is TRUE while the dialog is open when bc_alert_dialog() is given an id.
title String. The title.
description String or tag. Text under the title.
icon Tag. An icon shown above the title.
cancel String or list. The cancel button, as a label or a list with label and variant. Defaults to "Cancel".
confirm String or list. The confirm button, in the same form as cancel. Defaults to "Continue".
size String. "default" or "sm" for a narrower dialog.
open Bool. Whether the dialog starts open. Defaults to FALSE.
trigger String. Label for a button that opens the dialog, or NULL for no button.

Value

An htmltools tag. With a trigger, a tag list of the button and the dialog.

Details

Both actions close the dialog. NULL omits one.

Examples

bc_alert_dialog(
  title = "Are you absolutely sure?",
  description = "This cannot be undone.",
  trigger = "Show Dialog"
)

Are you absolutely sure?

This cannot be undone.


bc_alert_dialog(
  title = "Delete this chat?",
  description = "This cannot be undone.",
  confirm = list(label = "Delete", variant = "destructive"),
  trigger = "Delete Chat"
)

Delete this chat?

This cannot be undone.