Skip to content
Velkin LogoVelkin Logo
Velkin
VELKIN/UI

Modern UI components for product teams and their AI agents. Lit core, typed wrappers, live MCP.

sales@velkinui.com

Product

  • Docs
  • Components
  • Studio
  • Pricing

Resources

  • Quick start
  • Blog
  • Changelog
  • Roadmap
  • Status

Project

  • About
  • Contact
  • License
  • Privacy
  • Terms

© 2026 Velkin. MIT core · Pro licenses available.

VELKIN

Slider

A slider component for choosing a numeric value with label and validation.

vu-slider · @velkin/react/slider

Copy page

Import

React
npm i @velkin/react

import { VuSlider } from "@velkin/react/slider";

Examples

API

Props

PropTypeDefaultDescription
namestring—Form field name for submit (`name` attr).
defaultvaluestring—Restored on `<form reset>` (`defaultvalue` attr).
formidstring—External `<form>` id (`formid` attr).
disabledboolean—Non-interactive; blocks thumb dragging (`disabled` attr).
readonlyboolean—Focusable but cannot change the value (`readonly` attr).
requiredboolean—Blocks valid submit when invalid (`required` attr).
requiredmessagestring—Custom `valueMissing` message (`requiredmessage` attr).
labelstring""Plain-text label; slotted `label` wins when assigned.
hintstring""Helper text; `hint` slot wins when assigned.
idstring""Host id for label `for` / `aria-*` wiring.
variantVuSliderVariant"default"Field chrome recipe. Default: `"default"`.
toneVuSliderTone"normal"Neutral surface weight. Default: `"normal"`.
sizeVuSliderSize"md"Track scale. Default: `"md"`.
radiusVuSliderRadius"md"Corner preset (`none`/`sm`/`md`/`lg`/`full`). Default: `md`.
blockbooleanfalseStretches the control to the container width. Default: `false`.
compactbooleanfalseTighter label/hint/error spacing. Default: `false`.
minnumber0Minimum selectable value. Default: `0`.
maxnumber100Maximum selectable value. Default: `100`.
stepnumber1Step interval for snapping. Default: `1`.
valuenumber50Snapped slider value. Default: `50`.
displayvaluenumber—Live visual value while dragging when `commitonly`.
prefixstring""Text before the formatted value.
suffixstring""Text after the formatted value.
showvalueboolean—Shows the formatted value summary. Default: `true`.
commitonlyboolean—Emits `vu-change` on thumb commit only. Default: `false`.
showerrorsboolean—Shows validation after activation (`showerrors` attr). Default: `false`.
validationactiveboolean—Drives invalid styling after activation (`validationactive` attr). Default: `false`.
invalidbooleanfalseTrue when last validation found errors (`invalid` attr). Default: `false`.
arialabelstring—Names the track when no visible label is present.
displayValuenumber50Live visual value while dragging when `commitonly`.
showValuebooleantrueShows the formatted value summary.
commitOnlybooleanfalseEmits `vu-change` on thumb commit only.
ariaLabelstring""Names the track when no visible label is present.
showErrorsbooleanfalseShows validation after activation.
validationActivebooleanfalseDrives invalid styling after activation.

Events

EventDetailDescription
vu-changeVuSliderChangeDetailCommitted or live value update.
vu-invalidVuSliderInvalidDetailWhen validation messages are recomputed.
vu-clearVuSliderClearDetailAfter `reset()` syncs from `defaultValue`.

Slots

SlotDescription
labelRich label markup; takes precedence over string `label` when assigned.
hintOptional helper copy (HTML); overrides string `hint` when assigned.
errorReplaces default validation message list when assigned.

CSS parts

PartDescription
fieldColumn stacking label, header, track, hint, and error.
labelLabel element above the control.
headerRow with label and value summary.
controlInteractive track row (`.slider-track`) with variant chrome.
valueFormatted value summary.
affixPrefix or suffix text in the value summary.
highlightAccent fill from min to the current value.
thumb-visualVisible thumb on the highlight edge.
thumbNative `<input type="range">` drag target.
hintNeutral helper text under the track.
error-messageRegion for `slot="error"` or stacked default validation lines.
error-lineOne default validation string when `slot="error"` is empty.
textString `label` text when the `label` slot is empty.

Methods

MethodDescription
setValue- Sets value after clamp/snap and emits `vu-change`.
reset- Restores `defaultValue` and dispatches `vu-clear`.
validateInput- Runs validators and syncs validity.

Types

NameDefinition
VuSliderChangeDetail
{ value: number; }
VuSliderClearDetail
{ value: number; }
VuSliderInvalidDetail
{ errors: string[]; }
VuSliderRadius
"sm" | "md" | "lg" | "none" | "full"
VuSliderSize
"sm" | "md" | "lg"
VuSliderTone
"subtle" | "normal" | "strong"
VuSliderVariant
"outline" | "default" | "underline"

Related

Inputs

  • Advanced FilterAn advanced filter component with expression input and visual builder.
  • ButtonA clickable button component with multiple variants and states.
  • Button GroupA button group component with shared styling and optional selection.
  • CheckboxA checkbox component with label, hint, and validation.
  • Checkbox GroupA checkbox group component with shared label and validation.
  • Color AreaA two-dimensional color picker component for saturation and brightness.

Guides

  • FormsFormData, VuForm, and validation
  • EventsonVu* / v-model / e.detail
  • Appearancevariant, color, tone, size

Browse

  • Previous: SerialEarlier in the sidebar
  • Next: SwitchLater in the sidebar
  • All componentsBrowse the full index