For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/v0.4.0/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/v0.4.0/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/v0.4.0/en/components/button.md.

Button

Buttons trigger actions in the current interface. Use a link with href, styled as a button, when the outcome is navigation.

Save permission changes
Workspace access2 pending changes

Reviewer access and deployment approval are ready to update.

Ready to save.

Usage

Import Tailwind and the complete A3S style bundle:

@import "tailwindcss";
@import "@a3s-lab/ui/a3s.css";

Then add the btn class to a native button. Set type="button" explicitly so a button does not submit a form by accident.

<button type="button" class="btn">Save changes</button>

For component-level loading, import the base styles, Button structure, and A3S visual style in that order. See Installation for CDN and other integration paths.

@import "@a3s-lab/ui/base.css";
@import "@a3s-lab/ui/components/button.css";
@import "@a3s-lab/ui/styles/a3s.css";

Parameters

ParameterValuesPurpose
Root element<button> or <a>Use a button for actions and a link for navigation
classbtnRequired component root class
data-variantprimary, secondary, outline, ghost, link, destructiveSets action hierarchy; omission means primary
data-sizexs, sm, default, lg, icon-xs, icon-sm, icon, icon-lgSets target size and visual density
data-iconinline-start or inline-endPlace on inline icons to correct text-button spacing
Native statedisabled, aria-busy, aria-pressedExpresses unavailable, pending, and toggle states

Button has no JavaScript controller or dedicated framework hook. HTML, React, and Vue use the same native activation and state attributes; application state owns the asynchronous operation and its duplicate-submission guard.

States and variants

Keep one primary button in a decision region. Use secondary and outline for supporting actions, ghost for low-emphasis tools, and destructive only when the action has a clear destructive outcome. link is a visual variant; real navigation still uses <a href>.

Action hierarchy

disabled prevents interaction. Async actions should pair visible progress text with aria-busy="true". Application state updates aria-pressed for toggle buttons; the component does not own that state.

Pending and unavailable

Sizes

Choose size from interface density, not action importance. Default fits standard pages, sm fits compact toolbars, and lg fits low-density or touch-first surfaces. Use an icon-* size only for icon-only buttons.

Size and target area

Set data-icon on an icon next to text. Icon-only buttons need a name through aria-label. Link buttons retain native link semantics and browser behavior.

Icons and navigation

Accessibility

  • Use <button> for actions and <a href> for navigation. Do not imitate links with click handlers.
  • Every icon-only button needs an accessible name, usually through aria-label.
  • Keep a specific action label visible during loading, synchronize disabled with aria-busy="true", and set the duplicate-submission guard before awaiting host work.
  • Application state owns aria-pressed="true|false" for toggles. Buttons that reveal overlays use aria-expanded and aria-controls.
  • A destructive button communicates intent. When confirmation is required, pair it with Alert Dialog.
  • The A3S style pack provides one visible offset focus outline without a box-shadow halo. Do not remove it in application styles.