- Primary
- Outline
- Filled
- Ghost
- Subtle
- Danger
Basic Usage
Variants
Flux buttons come in several visual variants to match different UI contexts:Sizes
Buttons support three size variants:Icons
Leading Icons
Add an icon to the left side of the button text:Trailing Icons
Add an icon to the right side:Icon-Only Buttons
When no text is provided, the button automatically becomes square:Icon Variants
Control the icon style independently:Colors
Customize the primary variant with different colors:slate, gray, zinc, neutral, stone, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose.
Loading States
Buttons automatically show loading indicators for Livewire actions:Keyboard Shortcuts
Display keyboard shortcuts within buttons:Alignment
Control content alignment within the button:Links as Buttons
Buttons automatically render as<a> tags when using the href attribute:
Disabled State
Inset
Reduce internal padding to align with surrounding content:Tooltips
Buttons support inline tooltips:Button Groups
Group related buttons together:Props Reference
| Prop | Type | Default | Description |
|---|---|---|---|
variant | string | outline | Visual style: primary, outline, filled, ghost, subtle, danger |
size | string | base | Button size: xs, sm, base |
icon | string | - | Leading icon name |
icon:leading | string | - | Leading icon name (alternative) |
icon:trailing | string | - | Trailing icon name |
icon:variant | string | micro | Icon variant: mini, micro, outline |
color | string | - | Color for primary variant |
type | string | button | Button type: button, submit, reset |
loading | boolean | auto | Show loading indicator |
square | boolean | auto | Force square shape |
kbd | string | - | Keyboard shortcut to display |
align | string | center | Content alignment: start, center, end |
inset | string | - | Reduce padding: top, right, bottom, left or combinations |
href | string | - | URL to link to (renders as <a>) |
disabled | boolean | false | Disable the button |
Accessibility
- Buttons include proper
typeattributes - Icon-only buttons should include
aria-label - Disabled buttons are not keyboard accessible
- Loading states announce to screen readers
When using
wire:click with parameters, the loading indicator is automatically scoped to that specific action to prevent multiple buttons from showing loading states simultaneously.