Appearance
Appearance
import Slider from "@ui/Slider.vue"Let a user select a value along a line.
For each option, provide a description. Markdown is supported. Select a key from the options by setting v-model
const options = {
me: "Only I can find and edit this",
pod: "Me and other users on the instance can find and edit this",
everyone: "Everyone can find and edit this"
} as const;
const option = ref<keyof typeof options>("me");<Slider :options="options" v-model="option" label="Privacy level" />NOTE
To convey the intent of the input field, add either a text label (label prop) or a custom, screenreader-friendly label template. Read more on form field labelling
Either specify the label prop or add custom Html into the #label slot.
Add the prop autofocus to focus the slider as soon as it renders. Make sure to only autofocus one element per page.
If you want to aggregate potentially mixed states, or start with no initial selection, you can set v-model to undefined.
const optionWithUndefined = ref<keyof typeof options | undefined>(undefined)<Slider
v-model="optionWithUndefined"
label="Privacy level?"
:options="options"
/>Functionality
v-model)User interaction
range input: Design
A pin (same as in the toggle component)
a range (very faint)
Ticks?
Constant dimensions, fitting the largest text box
Not to be confused with a pearls navigation patterns (list of dots; indicates temporal range)