@props([ 'name', 'label' => null, 'hint' => null, 'on' => null, 'off' => null, ]) @php $id = $attributes->get('id', $name); @endphp {{-- An on/off control that reads as on/off. A two-option except(['id', 'class']) }}> {{-- Track. --}} {{-- Knob — sibling of the input, laid over the track. `top-1/2 -translate-y-1/2` rather than a top offset in pixels: an absolutely positioned flex child has no useful static position to fall back on, and a hard-coded offset would drift the moment the row's line-height changes. Tailwind composes translate-x and translate-y through separate custom properties, so the checked state can move it sideways without losing the centring. --}} @if ($on !== null && $off !== null) {{-- Gleiche Mindestbreite für beide Wörter, sonst wandert der Schalter beim Umlegen: „Wird versendet" ist breiter als „Nur ins Log", und die Zeile ist rechtsbündig. `min-w`, nicht `w` — eine längere Übersetzung darf schieben, aber nie abgeschnitten werden. --}} {{ $off }} @endif