kithkin/resources/views/components/button/index.blade.php

25 lines
494 B
PHP

@props([
'variant' => '',
'size' => 'default',
'type' => 'button',
'class' => '',
'label' => 'Icon button' ])
@php
$variantClass = match ($variant) {
'primary' => 'button--primary',
'secondary' => 'button--secondary',
default => '',
};
$sizeClass = match ($size) {
'sm' => 'button--sm',
'lg' => 'button--lg',
default => '',
};
@endphp
<button type="{{ $type }}" class="{{ $variantClass }} {{ $sizeClass }} {{ $class }}">
{{ $slot }}
</button>