Button
Nabu’s workhorse button: variants, sizes, icons, a loading state and links — springy press feedback, fully keyboard operable.
Real scenarios
The component as it is used in a product — not a specimen grid.
A settings card, closing cleanly
The primary action commits (watch the label become a spinner at the same width), the quiet one backs out, the dangerous one stands apart.
Icon-only toolbar
Same button, one glyph each — the label moves to aria-label.
Variants
From loud to quiet: primary, secondary, outline, ghost, danger, gold, inverse, link and glow.
Sizes, one line
xs to xl; press any of them — everything pressable scales down 4% while it is held.
Links & effects
href renders a real anchor; the effects are a passing gleam and a rolling label.
A full-width closer
block stretches to the container — the upgrade CTA at the end of a billing page.
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| variant | string | secondary | One of secondary · primary · outline · ghost · danger · gold · inverse · link · glow. |
| size | string | md | Sizes: xs · sm · md · lg · xl; shape sets pill or square corners. |
| icon / icon-end | string | null | An icon name (or your own SVG) leading or trailing the label; directional icons mirror in RTL. |
| icon-only | bool | false | Shows the icon alone; the slot text stays as the accessible label. |
| status | string | null | Manual loading · success · error state; with wire:click it follows wire:loading automatically. |
| href | string | null | With href the button renders an <a>; the button type is dropped. |
| effect | string | null | Hover effect: shine (a passing gleam) or slide (the label rolls over). |
| block | bool | false | Stretches to the container’s width — for full-width CTAs. |
Snippet
<x-nx::button variant="primary" icon="check" wire:click="save">
ذخیرهٔ تغییرات
</x-nx::button>
<x-nx::button variant="ghost" icon="trash" icon-only aria-label="حذف" />
<x-nx::button variant="secondary" href="/components" icon-end="arrow-right">
بازگشت به کاتالوگ
</x-nx::button>