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

25 lines
540 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="button button--icon {{ $variantClass }} {{ $sizeClass }} {{ $class }}" aria-label="{{ $label }}">
{{ $slot }}
</button>