19 lines
673 B
PHP
19 lines
673 B
PHP
@props([
|
|
'name',
|
|
'label' => null,
|
|
])
|
|
@php $id = $attributes->get('id', $name); @endphp
|
|
<label for="{{ $id }}" class="inline-flex items-center gap-2 text-sm text-body select-none">
|
|
<input
|
|
id="{{ $id }}"
|
|
name="{{ $name }}"
|
|
type="checkbox"
|
|
{{-- accent-color, not text-*: a native checkbox ignores text colour and
|
|
would otherwise tick in the browser's own blue, off-brand on every
|
|
page that uses one. --}}
|
|
{{ $attributes->merge(['class' => 'size-4 shrink-0 rounded border-line-strong accent-[var(--accent-active)]']) }}
|
|
>
|
|
@if ($label)<span>{{ $label }}</span>@endif
|
|
{{ $slot }}
|
|
</label>
|