Button
Primitives[atlasButton]Examples
Variants
Seven variants map to the intent of the action. primary is the default.
Sizes
sm for toolbars, default for forms, lg for calls to action, and icon for square icon- only buttons (give them an aria-label ).
Icons and states
Put an atlas-icon before the label; a disabled button is dimmed and ignores pointer events. loading marks a busy button ( aria-busy ) and ignores clicks, but keeps keyboard focus, unlike disabled .
API
Generated from the library source, so it always matches the code.
AtlasButtonDirective [atlasButton]
| Input | Type | Default | Description |
|---|---|---|---|
| variant | ButtonVariants['variant'] | 'primary' | primary (the main action), default (neutral), secondary , outline , ghost (toolbar and icon buttons), destructive (deleting, irreversible) or link . |
| size | ButtonVariants['size'] | 'default' | sm , default , lg , or icon (square, for an icon-only button with an aria-label ). |
| loading | unknown | false | aria-busy + aria-disabled , dimmed, clicks ignored. Unlike disabled , the button keeps keyboard focus while the work runs. |
| class | string | '' | cn() ; yours win on conflicts. |
Types
ButtonVariants
type ButtonVariants = VariantProps<typeof buttonVariants>