Button Beta
The next-generation button directive. Applies to <button><a>tg2Button
Styles
All our different variants of buttons are set by adding the tg2Style
States
Default size · square shape. Each variant has a distinct disabled treatment.
| Resting | Hover | Focus | Active | Disabled | Loading | |
|---|---|---|---|---|---|---|
| Primary - default | ||||||
| Secondary | ||||||
| Transparent | ||||||
| Destructive | ||||||
| Expressive | ||||||
| Enhanced |
Sizes
| Primary | Secondary | Destructive | Expressive | |
|---|---|---|---|---|
| Small (32px) | ||||
| Medium (40px) | ||||
| Large (48px) |
Shapes
Icons
| Primary | Secondary | Expressive | Destructive | |
|---|---|---|---|---|
| Leading | ||||
| Trailing |
Icon only
Two mutually exclusive inputs hide a button's label — pick based on whether it should ever be visible.
| Input | Label hidden | Use when |
|---|---|---|
[iconOnly] | Always, at every viewport size | The icon alone is always enough (e.g. a bare close or delete action) |
[iconOnlyBelow]smmd | Only below that breakpoint — the full label shows above it | The label helps on larger screens but the button needs to shrink on mobile |
The label text always stays in the DOM for screen readers. iconOnlyBelow
Conditional icon + label (toggle buttons)
Icon and label as siblings inside an @if@else
Links
Apply tg2Button<a><button>
| Primary | Secondary | Transparent |
|---|---|---|