Actions

Button

Flat tinted fill by default; only the primary action is solid. Padding is block × φ inline.

Examples

Variants

Sizes and icons

States

aria-busy swaps the label for three pulsing squares; data-toggle flips aria-pressed.

Anatomy

button.btnAny <button> or <a>. Use a link when it navigates, a button when it acts.
i.iconOptional leading or trailing icon; the gap is set for you.

API

AttributeValuesDescription
data-variantprimaryghostprimary is the one solid action on a screen; ghost has no fill until hover. Default flat tint.
data-sizeslSmaller or larger padding and type. Default sits between.
data-toneaccentsuccesswarningdangerinfoColours the primary fill, the ghost text and the pressed state.
data-iconbooleanSquare, icon-only button. Needs an aria-label.
aria-busytrueHides the label and pulses three squares in its place; the button ignores clicks.
aria-pressedtruefalseToggle state: tinted, with a 2px edge along the bottom so it reads without colour.
data-togglebooleanWith aria-pressed, aequitas.js flips the state on click.
disabledbooleanDims and ignores the pointer. aria-disabled="true" looks the same but stays focusable.
data-count<n>Count badge in the corner, from the attribute's value. Works on any element.
data-tip<text>Tooltip text; see Tooltip.

Behaviour

Clicking a [data-toggle] button flips its aria-pressed between true and false. Everything else is CSS.

From aequitas.js. It initialises itself and enhances markup added later on its own, so it works the same in an SPA.

Accessibility

  • Use a real <button> (or <a href> for navigation) so focus, Enter and Space work without script.
  • Icon-only buttons need an aria-label; the icon itself is decorative.
  • aria-busy blocks the pointer but not focus. Keep the label in the markup: screen readers still announce it.
  • Tone never carries meaning alone: a danger button says what it does ("Delete", not "OK").
KeyEffect
Enter / SpaceActivates a <button>. A link-button answers Enter only.
Jump to
ProportionFoundations
MaterialFoundations
PresetsFoundations
ShellLayouts · Application
Container and stacksLayouts · Pages
SplitLayouts · Pages
Grid, bento, masonryLayouts · Pages
Switcher and rowLayouts · Pages
↑↓Move↵OpenescClose