Button
Usage
Include CSS
Import Tailwind and one full A3S UI style bundle.
Or import only the base CSS, Button component CSS, and one style pack.
Using CDN or bundler imports? See the Installation page.
Add your button HTML
Add class="btn" to a <button> or <a>. Add data-variant and data-size when needed. Add data-icon="inline-start" or data-icon="inline-end" to inline icons when a text button needs icon-aware spacing.
HTML structure
<button class="btn">- Button root. Use a native
<button>for actions and<a>for navigation. data-variant="primary|secondary|outline|ghost|link|destructive"Optional- Visual variant. Omit it for the primary variant.
data-size="xs|sm|default|lg|icon|icon-xs|icon-sm|icon-lg"Optional- Button size. Omit it for the default size.
Variants
Sizes
Use data-size="icon" or one of the icon size variants for square buttons. Icon-only buttons need an accessible name, usually with aria-label.
Use data-icon="inline-start" or data-icon="inline-end" on inline icons when a text button needs icon-aware spacing. Use icon size variants only for icon-only buttons.
To group related buttons, use the Button Group component.
Examples
Size
Use data-size to change the size of the button.
Default
Outline
Secondary
Ghost
Destructive
Link
Icon
With icon
Use data-icon="inline-start" or data-icon="inline-end" on inline icons to match upstream icon-aware spacing.
Rounded
Use the rounded-full class to make the button rounded.
Spinner
Button group
To group related buttons, use the Button Group component.
RTL
Add dir="rtl" to the button or an ancestor. Flip directional icons explicitly.