generated from boboko/starter
27 lines
769 B
PHP
27 lines
769 B
PHP
@props([
|
|
'tag' => 'button',
|
|
'href' => null,
|
|
'type' => 'button',
|
|
'size' => 'lg',
|
|
])
|
|
|
|
@php
|
|
$tag = $href ? 'a' : $tag;
|
|
|
|
$sizeClasses = match($size) {
|
|
'sm' => 'py-2 px-6 text-sm',
|
|
'md' => 'py-3.5 px-6 text-base',
|
|
default => 'py-5 px-[46px] text-[19px]',
|
|
};
|
|
|
|
$class = 'btn-primary relative isolate inline-flex items-center justify-center border border-black font-display font-bold italic text-black cursor-pointer no-underline uppercase ' . $sizeClasses;
|
|
|
|
$attrs = $href
|
|
? $attributes->merge(['href' => $href, 'class' => $class])
|
|
: $attributes->merge(['type' => $type, 'class' => $class]);
|
|
@endphp
|
|
|
|
<{{ $tag }} {{ $attrs }}>
|
|
<span class="relative z-[1]">{{ $slot }}</span>
|
|
</{{ $tag }}>
|