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: boolean | 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: boolean | boolean[] | Disables the component. An array locks single thumbs instead, one entry per value in value order (missing = 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 |
fill Type: "normal" | "inverted" | "segments"Default"normal" | Which rail segments are painted: |
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 |
items Type: readonly (string | number | { readonly value: string | number; readonly label?: string | undefined; })[] | Named stops instead of a numeric scale, spaced evenly in list order: strings, numbers or For a scale that is a list, not a range: uneven numbers such as |
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: "end" | "start" | "center" | "left" | "right"Default'start' | 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: string | number | (string | number)[] | nullDefault0 | Used by v-model. |
multiple Type: boolean | numberDefaultfalse | Several thumbs: The model holds one value per thumb, or |
name Type: string | Defines the name of the input. The key inside a |
persistentHint Type: booleanDefaultfalse | Keeps the hint displayed. |
pt Type: (PtCompoundOf<"", { readonly parts: readonly ["root", "label", "description", "message", "hint", "box", "track", "bar", "ticks", "tick", "thumb"]; readonly states: readonly ["hasValue", "inRange", "readonly", "disabled", "warnings", "errors", "active"]; readonly wide: readonly ["hasValue", "readonly", "disabled", "warnings", "errors", "active"]; readonly node: { readonly tick: readonly ["inRange"]; }; }> & { label?: PtValue | undefined; track?: PtValue | undefined; root?: PtValue | undefined; "root:disabled"?: PtValue | undefined; "root:errors"?: PtValue | undefined; "root:warnings"?: PtValue | undefined; "root:readonly"?: PtValue | undefined; description?: PtValue | undefined; thumb?: PtValue | undefined; message?: PtValue | undefined; hint?: PtValue | undefined; "label:disabled"?: PtValue | undefined; "label:errors"?: PtValue | undefined; "label:warnings"?: PtValue | undefined; "label:readonly"?: PtValue | undefined; "description:disabled"?: PtValue | undefined; "description:errors"?: PtValue | undefined; "description:warnings"?: PtValue | undefined; "description:readonly"?: PtValue | undefined; "message:disabled"?: PtValue | undefined; "message:errors"?: PtValue | undefined; "message:warnings"?: PtValue | undefined; "message:readonly"?: PtValue | undefined; "hint:disabled"?: PtValue | undefined; "hint:errors"?: PtValue | undefined; "hint:warnings"?: PtValue | undefined; "hint:readonly"?: PtValue | undefined; "label:hasValue"?: PtValue | undefined; "root:hasValue"?: PtValue | undefined; "description:hasValue"?: PtValue | undefined; "message:hasValue"?: PtValue | undefined; "hint:hasValue"?: PtValue | undefined; box?: PtValue | undefined; "box:disabled"?: PtValue | undefined; "box:errors"?: PtValue | undefined; "box:warnings"?: PtValue | undefined; "box:readonly"?: PtValue | undefined; "box:hasValue"?: PtValue | undefined; "label:active"?: PtValue | undefined; "root:active"?: PtValue | undefined; "message:active"?: PtValue | undefined; "hint:active"?: PtValue | undefined; ticks?: PtValue | undefined; "track:disabled"?: PtValue | undefined; "track:errors"?: PtValue | undefined; "track:warnings"?: PtValue | undefined; "track:readonly"?: PtValue | undefined; "track:active"?: PtValue | undefined; "track:hasValue"?: PtValue | undefined; "description:active"?: PtValue | undefined; "thumb:disabled"?: PtValue | undefined; "thumb:errors"?: PtValue | undefined; "thumb:warnings"?: PtValue | undefined; "thumb:readonly"?: PtValue | undefined; "thumb:active"?: PtValue | undefined; "thumb:hasValue"?: PtValue | undefined; "box:active"?: PtValue | undefined; "bar:disabled"?: PtValue | undefined; "bar:errors"?: PtValue | undefined; "bar:warnings"?: PtValue | undefined; "bar:readonly"?: PtValue | undefined; "bar:active"?: PtValue | undefined; "bar:hasValue"?: PtValue | undefined; "ticks:disabled"?: PtValue | undefined; "ticks:errors"?: PtValue | undefined; "ticks:warnings"?: PtValue | undefined; "ticks:readonly"?: PtValue | undefined; "ticks:active"?: PtValue | undefined; "ticks:hasValue"?: PtValue | undefined; "tick:disabled"?: PtValue | undefined; "tick:errors"?: PtValue | undefined; "tick:warnings"?: PtValue | undefined; "tick:readonly"?: PtValue | undefined; "tick:active"?: PtValue | undefined; "tick:hasValue"?: PtValue | undefined; "tick:inRange"?: PtValue | undefined; } & { bar?: PtValue | PtItemFn<BbSliderSegment, BbSliderPtState, never, { readonly item: BbSliderSegment; }> | undefined; tick?: PtValue | PtItemFn<BbSliderSegment, BbSliderPtState, never, { readonly item: BbSliderSegment; }> | undefined; }) | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | ((ctx: PtItemCtx<BbSliderSegment, BbSliderPtState>) => PtItemResult) | Passthrough, attribute form: one attribute per part, |
readonly Type: booleanDefaultfalse | Sets the input in a readonly state. Keeps the thumb focusable and exposes |
reverse Type: boolean | Reverses the layout. Applicable in every direction the order of the label and the input is swapped. |
rules Type: RuleExpression<string | number | (string | 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: string | number | (string | number)[] | null |
|
Events
| Name | Description |
|---|---|
active Type: (value: BbSliderValue | null): void | Emitted when the slider gains focus and becomes interactive, with the current value. |
focus Type: (event: FocusEvent): void | Emitted when a thumb gains focus. Forwards the original DOM |
inactive Type: (value: BbSliderValue | null): void | Emitted when focus/click moves outside the slider after it was active, with the current value, whether or not it changed. Fires when focus or a click lands outside the slider, with the current value, whether or not it changed; not on drag release. To save, use |
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 or on the track. 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: string | number | (string | number)[] | null): void | Emitted with new value(s) whenever the slider position changes. A number for a single slider (an |
value-commit Type: (value: BbSliderValue): void | Emitted once the user finishes changing the value, after the last The hook for saving: on release after a drag and on each keyboard or stepper step, only when the value changed. Never for a value your code sets. See example |
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 |
hint Type: BbSliderDescriptionSlotProps | Replaces the hint text; alone it still renders the row. May hold an action. |
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 | Replaces every thumb's content; with Renders inside the thumb rather than replacing it, so content positioned against it travels with the handle. With |
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 silentlyrangemultiplefails silentlyA bare
multipleis the two-thumb intervalrangewas;:multiple="3"gives three thumbs. The model may now start empty ([])requiredremovedfails 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.- slot
thumb:higherthumbfails silentlyOne
#thumbslot renders every thumb; branch on itsindex(1is the higher end of two) - slot
thumb:lowerthumbfails silentlyOne
#thumbslot renders every thumb; branch on itsindex(0is the lower end) 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.