Button

Description

Create a button.

Usage

bc_button(
  ...,
  id = NULL,
  variant = "primary",
  size = "default",
  type = "button",
  aria_label = NULL
)

Arguments

Argument Description
... Tag attributes and content, such as the label.
id String or NULL. The button's ID. In a Shiny app, a button with an id is an action button, so input$id counts its clicks.
variant String. One of primary, secondary, outline, ghost, link, destructive.
size String. One of default, xs, sm, lg, icon, icon-xs, icon-sm, icon-lg.
type String. The button type. Defaults to "button". Use "submit" for a button that submits a form.
aria_label String. Accessible name for the button. Set it when the button has no visible text, such as an icon-only button.

Value

An htmltools tag.

Details

To place an icon beside the label, give the icon data-icon = "inline-start" or "inline-end".

Examples

bc_button("Save")

bc_button("Delete", variant = "destructive")

bc_button("Snooze", variant = "outline", size = "sm")