Alert

Description

Create a short message with an optional icon, title, body, and action.

Usage

bc_alert(
  ...,
  title = NULL,
  description = NULL,
  icon = NULL,
  action = NULL,
  variant = "default"
)

Arguments

Argument Description
... Tag attributes and extra content, placed after the other parts.
title String or tag. The title.
description String or tag. The body text.
icon Tag or NULL. An icon before the title, such as one from the phosphoricons package.
action Tag or NULL. A button or link, aligned to the end of the alert.
variant String. "default" or "destructive" for an error alert.

Value

An htmltools tag.

Examples

bc_alert(title = "Account updated", description = "Your changes are live.")

Account updated

Your changes are live.

bc_alert(
  title = "Payment failed",
  description = "Check your card and try again.",
  action = bc_button("Retry", variant = "outline", size = "sm"),
  variant = "destructive"
)

Payment failed

Check your card and try again.