Button

Description

A <button> carrying the Basecoat btn class.

Usage

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

Arguments

Argument Description
... Tag attributes and children for the <button>. The label is a child.
variant String. One of primary, secondary, outline, ghost, link, destructive. primary writes no attribute.
size String. One of default, xs, sm, lg, icon, icon-xs, icon-sm, icon-lg. default writes no attribute.
type String. The type attribute, "button" unless the button submits a form.
aria_label String. Accessible name, needed when the button has no visible text such as an icon-only button.

Value

A <button> tag.

Details

An icon beside text takes data-icon = "inline-start" or "inline-end".

Examples

bc_button("Save")

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

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