A range slider.
A port of the Pines range slider. This is a
native <input type="range"> styled entirely with Tailwind arbitrary variants — no
JavaScript at all, unless you opt into show_value.
The filled portion of the track is the interesting trick: Firefox exposes
::-moz-range-progress, but WebKit has no equivalent, so the fill is faked with a very
large one-sided box shadow on the thumb, clipped by the track's overflow: hidden.
<.range_slider name="volume" min={0} max={100} value={50} />
Summary
Forms
Renders a range slider.
Forms
Renders a range slider.
Examples
<.range_slider name="volume" label="Volume" value={70} show_value value_suffix="%" />
<.range_slider name="price" min={0} max={1000} step={50}
phx-change="filter" phx-debounce="200" />Attributes
id(:string) - Defaults tonil.name(:string) (required)value(:integer) - Defaults to50.min(:integer) - Defaults to0.max(:integer) - Defaults to100.step(:integer) - Defaults to1.label(:string) - Defaults tonil.hint(:string) - Defaults tonil.disabled(:boolean) - Defaults tofalse.show_value(:boolean) - Displays the live value beside the label. Requires Alpine. Defaults tofalse.value_suffix(:string) - Appended to the displayed value, e.g. "%". Defaults to"".class(:string) - Defaults tonil.container_class(:string) - Defaults tonil.- Global attributes are accepted.