Skip to main content

Range

Slider input for selecting a value in a range.

Usage

<w-range value="50" min="0" max="100" label="Volume">
<w-slot rail>
<div>
<w-slot fill><div></div></w-slot>
<w-slot knob><div></div></w-slot>
</div>
</w-slot>
</w-range>

Props

PropTypeDefaultDescription
valuenumber0Current value
minnumber0Minimum value
maxnumber100Maximum value
stepnumber1Step increment
labelstring""Accessible label
disabledbooleanfalseDisable slider
orientation"horizontal" | "vertical""horizontal"Slider orientation

Slots

SlotElementDescription
trackContainerSlider track container
fillElementFilled portion of track
thumbElementDraggable thumb

Events

EventDetailDescription
change{ value }Value changed (on release)
input{ value }Value changing (while dragging)

Keyboard

KeyAction
ArrowRight / ArrowUpIncrement
ArrowLeft / ArrowDownDecrement
HomeSet to minimum
EndSet to maximum
PageUpIncrement by 10%
PageDownDecrement by 10%

Accessibility

  • role="slider" with full ARIA value attributes
  • Keyboard accessible
  • Works with screen readers