@props([ 'variant' => 'primary', // primary | secondary | danger | success | ghost | link 'size' => 'md', // md | sm 'href' => null, 'navigate' => true, // SPA navigation for internal links 'icon' => null, 'iconRight' => null, 'type' => 'button', 'loading' => null, // wire:target for the loading spinner ]) @php $classes = 'btn btn-'.$variant.($size === 'sm' ? ' btn-sm' : ''); $iconClass = $size === 'sm' ? 'size-4' : 'size-[18px]'; @endphp @if ($href) merge(['class' => $classes]) }}> @if ($icon)@endif {{ $slot }} @if ($iconRight)@endif @else @endif