For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/v0.4.1/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/v0.4.1/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/v0.4.1/en/components/button.md.
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.
Place on inline icons to correct text-button spacing
Native state
disabled, aria-busy, aria-pressed
Expresses 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.
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>.
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.
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.
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.
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.