Props
| Name | Type | Default | Description |
|---|---|---|---|
autofocus | Booleanish | undefined | - | Sets autofocus on page load. |
compact | boolean | undefined | false | Set the component in compact mode. A property of a screen, not of a control. One dense slider among five roomy ones reads as a mistake. See example |
description | string | undefined | - | Descriptive text displayed below the label and above the input. Unlike the hint it is always
visible, and it is linked to the input via Read before anything moves, which makes it the place to say what the interval means — and to explain a |
direction | InputDirection | undefined | - | Direction of the layout of the component. Can either be a predefined value or a
pattern separated by a space like Applies only while the resolved label mode is |
disabled | boolean | undefined | false | Disables the component. Removes the thumb from the tab order, so a disabled value is unreachable for someone navigating by keyboard. Prefer |
disableThumbTranslate | boolean | undefined | false | Disables the proportional thumb translation that keeps the thumb on track (enabled by default). Set it when displaying ticks so they align with less effort. Turns off the proportional nudge that keeps the thumb over the track at the extremes; set it with |
errors | string | string[] | undefined | - | Can be a string or an array of string containing the messages to display.
They render in an Rare on a bounded control — the interval already prevents most invalid values — but available for the rules a range cannot express. Wired to every thumb through |
hasErrors | boolean | undefined | false | Define if the component should be in an error state. It usually attaches a CSS class for styling purposes. |
hasWarnings | boolean | undefined | false | Define if the component should be in a warning state.
Same chrome as errors with |
hideLabel | boolean | undefined | false | Visually hides the label of the input while maintaining accessibility. Keeps the accessible name and removes only the visible text, for a filter whose surrounding heading already names it. Omitting |
hint | string | undefined | - | Text box to be displayed near the input, usually to indicate instructions. |
id | string | undefined | - | The identifier of the component. |
labelrequired | string | - | Text content of the label of the element. |
labelMode | "outside" | "inside" | undefined | - | Label rendering mode.
Sliders do not support Two values, not three. A slider has no empty-versus-filled state for a label to float against, so an explicit |
labelPosition | "left" | "center" | "right" | undefined | - | Sets the text alignment of the label. |
max | number | undefined | 100 | Maximum value cap. Validated at mount together with |
maxPrecision | number | undefined | 2 | Maximum decimal places to retain in emitted values. What keeps |
min | number | undefined | 0 | Minimum value cap. Validated at mount; see |
modelValuerequired | number | number[] | null | 0 | Used by v-model. |
name | string | undefined | - | Defines the name of the input. Renders a hidden input carrying the JSON-serialised value under this name, for a classic form post. |
persistentHint | boolean | undefined | false | Keeps the hint displayed. |
pt | PtMap<BbSliderPtPart, BbSliderPtState> | undefined | - | Passthrough, object form: the same keys as the |
pt:description | PtValue | undefined | - | |
pt:description:active | PtValue | undefined | - | |
pt:description:disabled | PtValue | undefined | - | |
pt:description:errors | PtValue | undefined | - | |
pt:description:readonly | PtValue | undefined | - | |
pt:description:warnings | PtValue | undefined | - | |
pt:hint | PtValue | undefined | - | |
pt:hint:active | PtValue | undefined | - | |
pt:hint:disabled | PtValue | undefined | - | |
pt:hint:errors | PtValue | undefined | - | |
pt:hint:readonly | PtValue | undefined | - | |
pt:hint:warnings | PtValue | undefined | - | |
pt:label | PtValue | undefined | - | |
pt:label:active | PtValue | undefined | - | |
pt:label:disabled | PtValue | undefined | - | |
pt:label:errors | PtValue | undefined | - | |
pt:label:readonly | PtValue | undefined | - | |
pt:label:warnings | PtValue | undefined | - | |
pt:message | PtValue | undefined | - | |
pt:message:active | PtValue | undefined | - | |
pt:message:disabled | PtValue | undefined | - | |
pt:message:errors | PtValue | undefined | - | |
pt:message:readonly | PtValue | undefined | - | |
pt:message:warnings | PtValue | undefined | - | |
pt:root | PtValue | undefined | - | |
pt:root:active | PtValue | undefined | - | |
pt:root:disabled | PtValue | undefined | - | |
pt:root:errors | PtValue | undefined | - | |
pt:root:readonly | PtValue | undefined | - | |
pt:root:warnings | PtValue | undefined | - | |
pt:thumb | PtValue | undefined | - | |
pt:thumb:active | PtValue | undefined | - | |
pt:thumb:disabled | PtValue | undefined | - | |
pt:thumb:errors | PtValue | undefined | - | |
pt:thumb:readonly | PtValue | undefined | - | |
pt:thumb:warnings | PtValue | undefined | - | |
pt:track | PtValue | undefined | - | |
pt:track:active | PtValue | undefined | - | |
pt:track:disabled | PtValue | undefined | - | |
pt:track:errors | PtValue | undefined | - | |
pt:track:readonly | PtValue | undefined | - | |
pt:track:warnings | PtValue | undefined | - | |
range | boolean | undefined | false | Set the input as range. modelValue must be an array. Only one of the two mismatches is loud: |
readonly | boolean | undefined | false | Sets the input in a readonly state. Keeps the thumb focusable and exposes |
required | boolean | undefined | false | Sets the input as required. |
reverse | boolean | undefined | false | Reverses the layout. Applicable in every direction the order of the label and the input is swapped. |
step | number | undefined | 1 | The step attribute specifies the granularity that the value must adhere to. The resolution every value snaps to, and the distance the arrow keys move. Must be finite and greater than zero, or the component throws at mount. See example |
ticks | boolean | undefined | false | Displays ticks on step. Lays out one positioned element per step below the track and renders the |
warnings | string | string[] | undefined | - | Warning messages to display beneath the field, in their own The amber channel: accepted, and worth a second look. Suppressed entirely when the slider also has errors. See example |
v-model
Values kept in sync through v-model.
| Name | Type | Description |
|---|---|---|
modelValue | number | number[] | null |
|
Events
| Name | Type | Description |
|---|---|---|
active | (event: "active"): void | |
focus | (event: "focus", event: FocusEvent): void | |
inactive | (event: "inactive"): void | Fires when the interaction ends — the hook for a commit-on-release save. Never derive the value from it: |
keydown | (event: "keydown", event: KeyboardEvent): void | |
pointerdown | (event: "pointerdown", event: PointerEvent): void | |
pointermove | (event: "pointermove", event: PointerEvent): void | |
pointerup | (event: "pointerup", event: PointerEvent): void | |
update:modelValue | (event: "update:modelValue", value: number | number[]): void |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Type | Description |
|---|---|---|
append | BbSliderStepSlotProps | Content rendered after the slider track, typically used to add a max-value label or button. The other half of the stepper pair; see |
description | BbSliderDescriptionSlotProps | Replaces the description text. Provided alone (no |
label | BbSliderLabelSlotProps | Replaces the default label text rendered above the slider. |
prepend | BbSliderStepSlotProps | Content rendered before the slider track, typically used to add a min-value label or button. Receives |
thumb | BbSliderThumbSlotProps | Fallback thumb used for non-range sliders (or inside Renders inside the thumb rather than replacing it, so content positioned against it travels with the handle. Receives |
thumb:higher | BbSliderThumbSlotProps | Replaces the default higher-value thumb in range mode ( The higher handle of a range. Falls back to |
thumb:lower | BbSliderThumbSlotProps | Replaces the default lower-value thumb in range mode ( The lower handle of a range. Falls back to |
tick | BbSliderTickSlotProps | Replaces the default tick mark rendered at each step when ticks are enabled. Receives |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
colorremovedfails silentlyhasWarninghasWarningsfails silentlythumbTranslatedisableThumbTranslatefails silently