Guides
Navigation
Feedback
Overlays
Layout
Data Display
Forms
.md

Forms

button

Clickable button with variant and size options.

Installation

php artisan ui:add button

Usage

<x-ui.button>Save</x-ui.button>
<x-ui.button variant="outline" size="lg">Cancel</x-ui.button>
<x-ui.button variant="destructive" size="sm">Delete</x-ui.button>
<x-ui.button type="submit">Submit the form</x-ui.button>

{{-- With an href it renders an <a> carrying the same styles --}}
<x-ui.button variant="ghost" href="/pricing">See pricing</x-ui.button>

Consumes theme tokens injected by `php artisan ui:init`.

Props

Every prop with its default. Pass any of them as attributes, using : to bind a PHP value.

@props([
    'variant' => 'default',
    'size' => 'md',
    'type' => 'button',
    'href' => null,
])