Button
Displays a button or a link styled as a button.
Usage
Variants
Use the variant prop to change the visual style.
Sizes
Icon buttons
Use size="icon-*" for square icon-only buttons. Put SVG or icon components in the slot.
Links
Render as an anchor with as="a" and an href:
Loading
Use the loading prop for a forced busy state (docs, Alpine demos, non-Livewire apps). Pair with loadingText for the busy label.
Forced state
Alpine demo
Toggle loading in the browser — works on static exports (no Livewire):
Livewire loading
When you pass wire:click / wire:submit, the button wires wire:loading automatically. Use loadingText for the busy label:
example.blade.php
<x-slate::button wire:click="save" loading-text="Saving…">
Save
</x-slate::button>
The control disables for the request and swaps to a spinner + loading text. See Livewire for more.
Disabled
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant |
default, secondary, outline, ghost, destructive, link |
default |
Visual style |
size |
xs, sm, default, lg, icon, icon-xs, icon-sm, icon-lg |
default |
Size preset |
rounded |
none, sm, md, lg, xl, full |
md |
Border radius |
animation |
auto, none, subtle, lift |
auto |
Hover micro-animation |
loading |
bool |
false |
Forced busy state (spinner + disabled) |
loadingText |
string |
null |
Busy label for loading or Livewire wire:loading |
as |
button, a |
button |
HTML element |
type |
button, submit, reset |
button |
Button type when as="button" |