-
Notifications
You must be signed in to change notification settings - Fork 1
Button
These Button components provide styled, accessible buttons with multiple variants and sizes, including a special floating circular button. They support loading states, icons, tooltips, hints, and links. Tailwind CSS and Alpine.js are used for styling and interactivity.
Button (standard):
<x-button variant="outline" size="sm" loading="test" wire:click="test" :hideTextWhileLoading="true" tooltip="test" hint="test">
Test
</x-button>Floating Button (circular):
<x-button.floating loading="test" wire:click="test" color="secondary" hint="test" tooltip="test" icon="icon-airplay" />-
variant(string): Style variant of the button. Defaults tosolid. Other example:outline. -
color(string): Color theme, e.g.primary(default),secondary,inverse,info,danger,warning,success -
size(string): Size of the button. Options:sm,md(default),lg. -
link(string|null): If set, renders an<a>tag instead of a<button>, linking to this URL. -
loading(string|bool|null): If truthy, shows a loading spinner and disables the button. Can bind to Livewire loading targets. -
hideTextWhileLoading(bool): Whether to hide the button text while loading (defaultfalse). -
tooltip(string|null): Tooltip text to show on hover, using Alpine.js tooltip. -
hint(string|null): Additional small hint text shown below the button.
A circular, square-aspect button ideal for floating action buttons with icon support.
-
variant(string): Style variant, default issolid. -
color(string): Color theme, e.g.primary(default),secondary,inverse,info,danger,warning,success -
size(string): Size of the button. Options:sm,md(default),lg. -
link(string|null): If set, renders an<a>tag instead of a<button>. -
loading(string|bool|null): Shows a spinner and disables button when true. -
hideTextWhileLoading(bool): Whether to hide text during loading (defaulttrue). -
hint(string|null): Optional hint text below the button. -
icon(string|null): Icon class name to show inside the button. -
tooltip(string|null): Tooltip text shown on hover.
These Button components give you flexible, fully accessible buttons styled with Tailwind CSS. The main <x-button> is a rectangular button with multiple variants and color schemes. The <x-button.floating> is a compact circular button designed for icon-only usage, ideal as floating action buttons or minimal UI controls. Both support loading states with optional spinners, tooltips, hints, and Livewire integration for dynamic interactivity.