@props([ 'min', 'max', 'minValue' => null, 'maxValue' => null, 'step' => 1, 'name' => null, 'legend' => 'Range', 'minLabel' => 'Minimum', 'maxLabel' => 'Maximum', 'prefix' => '', 'suffix' => '', 'separator' => ' – ', ]) {{-- The default slot sits on the readout row, to the right of the min–max text — use it for a "clear"/"reset" control when the slider is filtered. Left empty otherwise. --}} @php $minValue ??= $min; $maxValue ??= $max; // Stable when a name is given so focus can survive a re-render; random // otherwise, just to keep the label/input association unique on the page. $uid = 'rs-' . ($name ?: uniqid()); @endphp
merge(['class' => 'flex flex-col gap-4']) }} >
{{ $legend }} {{-- Real controls — keyboard, assistive tech, form values, no-JS fallback. The controller adds `sr-only` to each on connect. --}} {{-- Presentational track — pointer control + visual state only; the real controls above own accessibility. --min / --max start at the extremes so first paint has no jump. --}}
{{-- Server-rendered so it's right on first paint and without JS; the controller rewrites it as the values change. --}} {{ $slot }}