Components / Base / Button

B1 · Base

Button

Primary, ghost, and small actions from the shared stylesheet.

When to use

  • The control does something on the page.
  • A link that looks like an action would be misleading.

When not to use

  • The control navigates. Use a link.
  • The choice is one of several filters. Use a chip or tabs.

Usage

<button type="button" class="btn">Primary</button>
<button type="button" class="btn ghost">Ghost</button>
<button type="button" class="btn sm">Small</button>

Variants

Ghost

Disabled

Props

NameTypeDefaultDescription
.btnclass—Accent fill, white text, 8 px radius.
.btn.ghostclass—Surface fill and a line.
.btn.smclass—Shorter padding for toolbars.
disabledattributeabsentRemoves the action.

Keyboard

KeyAction
Enter or SpaceActivates the button.

Accessibility

Motion

Pattern origin

Base control in yravg-ui v1.0.

Related

Pill buttonsDialogToast