Alert
Description
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 any further children, placed after the parts written by the named arguments. |
title |
String or tag. The alert's heading, as an <h2>. |
description |
String or tag. The body, as a <section>. |
icon |
Tag or NULL. An icon before the title, such as one from the phosphoricons package. |
action |
Tag or NULL. A button or link, placed in a <footer> that Basecoat aligns to the inline end. |
variant |
String. "destructive" for an error alert, or "default". |
Value
A <div> tag.
Examples
bc_alert(title = "Account updated", description = "Your changes are live.")
Account updated
bc_alert(
title = "Payment failed",
description = "Check your card and try again.",
action = bc_button("Retry", variant = "outline", size = "sm"),
variant = "destructive"
)