Products · Components

Slider

Chooses a number by dragging along a line.

For a small count the person changes one at a time, use a Stepper.

Children: Nothing

Example

The Slider component
view.dml
<Slider label="Volume" value="{{ volume }}" min="0" max="100" step="10" showValue onChange="setVolume" />
controller.ts
export default definePage({
  initialState: { volume: 40 },
  mutations: {
    setVolume: (_state, event: ValueEvent<number>) => ({ volume: event.detail.value }),
  },
});

Props

PropTypeWhat it is
valuenumber
minnumberDefault: 0.
maxnumberDefault: 100.
stepnumberDefault: 1.
showValueboolean
labelstring
hintstringHelp shown under the field, which error replaces.
disabledbooleanDims it, and the person can't use it.

Events

EventSendsNotes
onChange{ value } in detailThe new value, as a number.

Keep reading

On this page