Props
| Name | Description |
|---|---|
autofocus Type: Booleanish | Focuses the field when it mounts (a dialog already open included), unless the user is typing in another field. |
compact Type: booleanDefaultfalse | Compact density. The track's height follows A property of a screen, not of a control. One dense slider among five roomy ones reads as a mistake. See example |
description Type: string | Text between the label and the input. Unlike the hint it is always visible; it joins the input's Read before anything moves, which makes it the place to say what the interval means, and to explain a |
disabled Type: booleanDefaultfalse | Disables the component. Removes the thumb from the tab order, so a disabled value is unreachable for someone navigating by keyboard. Prefer |
disableThumbTranslate Type: booleanDefaultfalse | 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 Type: string | string[] | Error messages under the field, a string or array, 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 |
formless Type: booleanDefaultfalse | Keep this control out of the enclosing For a slider inside a form that is not form data, such as a zoom level or a preview size. See example |
hasErrors Type: booleanDefaultfalse | Define if the component should be in an error state. It usually attaches a CSS class for styling purposes. |
hasWarnings Type: booleanDefaultfalse | Define if the component should be in a warning state. Same chrome as errors with |
hideLabel Type: booleanDefaultfalse | 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 Type: string | Text box to be displayed near the input, usually to indicate instructions. |
id Type: string | The |
inputAlign Type: FieldCrossAlign | Vertical position of the control in a side-by-side row; not |
label requiredType: string | Text content of the label of the element. |
labelAlign Type: FieldCrossAlign | Vertical position of the label block in a side-by-side row; not |
labelMode Type: "outside" | "inside" | 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 Type: "left" | "center" | "right" | Sets the text alignment of the label. |
layout Type: Responsive<FieldLayout> | How label and input sit together: Applies only while the resolved label mode is |
max Type: numberDefault100 | Maximum value cap. Validated at mount together with |
maxPrecision Type: numberDefault2 | Maximum decimal places to retain in emitted values. What keeps |
min Type: numberDefault0 | Minimum value cap. Validated at mount; see |
modelValue Type: number | number[] | nullDefault0 | Used by v-model. |
name Type: string | Defines the name of the input. The key inside a |
persistentHint Type: booleanDefaultfalse | Keeps the hint displayed. |
pt Type: PtMap<BbSliderPtPart, BbSliderPtState> | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | Passthrough, attribute form: one attribute per part, |
range Type: booleanDefaultfalse | Set the input as range. modelValue must be an array. Only one of the two mismatches is loud: |
readonly Type: booleanDefaultfalse | Sets the input in a readonly state. Keeps the thumb focusable and exposes |
reverse Type: booleanDefaultfalse | Reverses the layout. Applicable in every direction the order of the label and the input is swapped. |
rules Type: RuleExpression<number | number[] | null> | vee-validate rules for this field. Only inside a Rules that restate |
step Type: numberDefault1 | The step attribute specifies the granularity that the value must adhere to. The grid every value snaps to, from the pointer, the keys and the steppers alike. When |
ticks Type: booleanDefaultfalse | Displays ticks on step. Lays out one positioned element per step below the track and renders the |
validationLabel Type: string | The field's name in validation messages ( |
validationMode Type: ValidationMode | When the field validates: |
warnings Type: string | string[] | Warning messages under the field, a string or array: amber, 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 | Description |
|---|---|
modelValue Type: number | number[] | null |
|
Events
| Name | Description |
|---|---|
active Type: (): void | Emitted when the slider gains focus and becomes interactive. |
focus Type: (event: FocusEvent): void | Emitted when a thumb gains focus. Forwards the original DOM |
inactive Type: (): void | Emitted when focus/click moves outside the slider after it was active. Fires when the interaction ends: the hook for a commit-on-release save. Never derive the value from it: |
keydown Type: (event: KeyboardEvent): void | Emitted for keyboard interaction on a thumb. Forwards the original DOM |
pointerdown Type: (event: PointerEvent): void | Emitted when a pointer device is pressed on a thumb. Forwards the original DOM |
pointermove Type: (event: PointerEvent): void | Emitted as a pointer device moves while dragging a thumb. Forwards the original DOM |
pointerup Type: (event: PointerEvent): void | Emitted when a pointer device is released after dragging. Forwards the original DOM |
update:modelValue Type: (value: number | number[]): void | Emitted with new value(s) whenever the slider position changes. Single number for single slider, array for range mode. |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
append Type: 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 Type: BbSliderDescriptionSlotProps | Replaces the description text. Provided alone (no |
label Type: BbSliderLabelSlotProps | Replaces the default label text rendered above the slider. |
prepend Type: BbSliderStepSlotProps | Content rendered before the slider track, typically used to add a min-value label or button. Receives |
thumb Type: 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 Type: BbSliderThumbSlotProps | Replaces the default higher-value thumb in range mode ( The higher handle of a range. Falls back to |
thumb:lower Type: BbSliderThumbSlotProps | Replaces the default lower-value thumb in range mode ( The lower handle of a range. Falls back to |
tick Type: BbSliderTickSlotProps | Replaces the default tick mark rendered at each step when ticks are enabled. Receives |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
colorremovedfails silentlydirectionlayoutfails silentlyhasWarninghasWarningsfails silentlyrequiredremovedfails silentlyA slider's role cannot carry
required, so it carries none (like BbCheckboxGroup / BbSwitchGroup). Delete the prop; inside a BbForm arequiredrule or the schema still validates it and shows the asterisk.thumbTranslatedisableThumbTranslatefails silentlyvalidateOnvalidationModefails silentlyAn array of events became one mode (
aggressive|balanced|lazy|submit-only|submit-live). The old defaults (['blur'],['inactive'], a toggle's['update:modelValue', 'change', 'blur']) arebalanced, the new default: delete the prop. A text field on['update:modelValue']isvalidation-mode="aggressive". Set it once on<BbForm validation-mode>instead of per field.vidremovedfails silentlyA display name (v2:
vid="Email address") is nowvalidation-label; a field path (3.0 betas:vid="address.city") is nowname(brackets for a native post:address[city]).check --fixpicks by the value.