schaefersoft/laravel-headless-ui
A single- or dual-thumb slider with a filled track segment and optional synced inputs or display elements.

Blade components: x-hui::range-slider, x-hui::range-slider.track, x-hui::range-slider.track.value, x-hui::range-slider.thumb, x-hui::range-slider.input
<x-hui::range-slider>
<x-hui::range-slider.track>
<x-hui::range-slider.track.value/>
<x-hui::range-slider.thumb role="min" name="lower" min="0" max="100" step="1" value="20"/>
<x-hui::range-slider.thumb role="max" name="upper" min="0" max="100" step="1" value="80"/>
</x-hui::range-slider.track>
</x-hui::range-slider>
[!IMPORTANT] Each thumb requires a
roleofminormax(or theSchaefersoft\HeadlessUI\Enums\RangeSlider\ThumbRoleenum).
Fills from the thumb to the max edge.

<x-hui::range-slider>
<x-hui::range-slider.track>
<x-hui::range-slider.track.value/>
<x-hui::range-slider.thumb role="min" min="0" max="100" step="1" value="35"/>
</x-hui::range-slider.track>
</x-hui::range-slider>
Fills from the min edge to the thumb.

<x-hui::range-slider>
<x-hui::range-slider.track>
<x-hui::range-slider.track.value/>
<x-hui::range-slider.thumb role="max" min="0" max="100" step="1" value="65"/>
</x-hui::range-slider.track>
</x-hui::range-slider>
Mirror thumb values into inputs or display elements placed inside the slider.
step and are clamped to prevent crossing.data-hui-range-slider-value has its text content kept in sync.<x-hui::range-slider>
<x-hui::range-slider.track>
<x-hui::range-slider.track.value/>
<x-hui::range-slider.thumb role="min" min="0" max="100" step="1" value="20"/>
<x-hui::range-slider.thumb role="max" min="0" max="100" step="1" value="80"/>
</x-hui::range-slider.track>
<div>
<x-hui::range-slider.input role="min" class="w-20"/>
<span data-hui-range-slider-value="min"></span>
</div>
<div>
<x-hui::range-slider.input role="max" class="w-20"/>
<span data-hui-range-slider-value="max"></span>
</div>
</x-hui::range-slider>
[!NOTE]
- For single-thumb sliders, the missing side is treated as the edge (min or max) for fill and display.
- Clicking the track moves the closest thumb; if equidistant, the click side determines which thumb moves.
All components except x-hui::range-slider.thumb accept a class attribute. Since the thumb renders a native <input type="range"/>, it must be styled through CSS pseudo-elements:
.hui-range-slider .hui-range-slider-thumb::-webkit-slider-thumb,
.hui-range-slider .hui-range-slider-thumb::-moz-range-thumb {
background: green;
}
| Prop | Type | Default | Description |
|---|---|---|---|
class |
string |
"" |
Custom classes for the wrapper. |
[!NOTE] Allows all valid HTML
<div/>attributes (class, style, data-*, etc.).
| Prop | Type | Default | Description |
|---|---|---|---|
class |
string |
"" |
Custom classes for the track. |
[!NOTE] Allows all valid HTML
<div/>attributes (class, style, data-*, etc.).
| Prop | Type | Default | Description |
|---|---|---|---|
class |
string |
"" |
Custom classes for the filled track area. |
[!NOTE] Allows all valid HTML
<div/>attributes (class, style, data-*, etc.).
| Prop | Type | Default | Description |
|---|---|---|---|
role |
string or ThumbRole |
(required) | Determines if the thumb is the upper (max) or lower (min) value. |
[!NOTE] Renders a native
<input type="range"/>. Allows all valid HTML<input/>attributes (min, max, step, value, disabled, name, etc.).
| Prop | Type | Default | Description |
|---|---|---|---|
role |
string or ThumbRole |
(required) | Which thumb this input syncs with (min or max). |
[!NOTE] Renders a native
<input/>. Allows all valid HTML<input/>attributes (class, style, data-*, etc.).
Native <input type="range"> keyboard controls apply:
| Key | Action |
|---|---|
ArrowLeft / ArrowDown |
Decrease value by one step |
ArrowRight / ArrowUp |
Increase value by one step |
aria-disabled="true" when all thumbs are disabled.How can I help you explore Laravel packages today?