{{-- A switch, M3's: a 52×32 track whose handle grows and slides across when it turns on. On a real checkbox with `role="switch"`, so it is focusable, announced as on or off, and takes Space from the keyboard; the handle is drawn beside it. `label` and `hint` sit beside it and are its name — a switch without `label` needs an `aria-label`. `right` puts it at the end of the row, where a setting's switch usually is. `icons` draws a check on the handle when on and a cross when off; `icons="selected"` only the check. Every other attribute reaches the `` (resources/css/components/selection.css). --}} @props([ 'label' => null, 'hint' => null, 'right' => false, 'icons' => false, ]) @php $model = $attributes->whereStartsWith('wire:model')->first(); $id = $attributes->get('id') ?? 'switch-'.substr(md5($model.'|'.$label), 0, 12); $icons = $icons === 'selected' ? 'selected' : ($icons ? 'both' : null); @endphp
only(['class', 'wire:key'])->class(['min-w-0']) }}>