EN
Getting started
65 · Forms

Slider

A slider for picking a value from a numeric range. When a label is given, the selected value is shown live, with its unit, to the right of the label.

PRO acun:range
01

Basic usage

The default range is 0–100. Give the initial value with value; if omitted, min is used. unit is appended to the value. When bound with wire:model or x-model, the value in the label follows the model: when the server changes the value (filling, resetting), the label updates too.

LIVE EXAMPLE
<acun:range name="rate" label="Customer satisfaction target" :value="85" unit="%" />
PropValues
valueInitial value
unitText appended to the value
02

Range and step

Set the range and the increment with min, max and step. If you want a space between the value and the unit, put the space at the start of the unit (" km").

LIVE EXAMPLE
<acun:range name="radius" label="Search radius" :min="1" :max="50" :value="10" unit=" km" />
<acun:range name="budget" label="Campaign budget" :min="0" :max="5000" :step="250" :value="1500" unit=" ₺" />
PropValues
min0
max100
step1
03

Without a label

If label is not given, the value is not shown either. In that case, add aria-label to tell screen readers what the field is; the attribute is passed directly to the slider.

LIVE EXAMPLE
<acun:range name="volume" :value="40" aria-label="Notification volume" />
PropValues
aria-labelInvisible accessible name
04

With Livewire

Bind it with wire:model; the value in the label follows the model and also updates when the server changes the value. So that it also looks right when the page first loads, give the same value as value too.

BLADE
<acun:range wire:model.live="radius" label="Search radius" :min="1" :max="50" :value="$radius" unit=" km" />
PropValues
wire:modelThe bound Livewire property
API

Props and slots

The values the component accepts.

PropDefaultDescription
labelnullLabel; if given, the value is shown next to it
min0Minimum value
max100Maximum value
step1Increment
valuenullInitial value; min when empty
unit''Unit appended to the value ("%", " km")
Slots: Attributes such as name, wire:model, disabled and aria-label are added to the slider field.
Acun UI · SliderDetailed usage and examples