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

Range

A range slider component for choosing a min-max interval with validation.

vu-range · @velkin/react/range

Copy page

Import

React
npm i @velkin/react

import { VuRange } from "@velkin/react/range";

Examples

API

Props

PropTypeDefaultDescription
namestring—Form field name for submit (`name` attr).
defaultvaluestring—Restored on `<form reset>` as `"from,to"` (`defaultvalue` attr).
formidstring—External `<form>` id (`formid` attr).
disabledboolean—Non-interactive; blocks thumb dragging (`disabled` attr).
readonlyboolean—Focusable but cannot change the range (`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.
variantVuRangeVariant"default"Field chrome recipe. Default: `"default"`.
toneVuRangeTone"normal"Neutral surface weight. Default: `"normal"`.
sizeVuRangeSize"md"Track scale. Default: `"md"`.
radiusVuRangeRadius"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`.
fromnumber20Lower bound of the selected range. Default: `20`.
tonumber80Upper bound of the selected range. Default: `80`.
minnumber0Minimum selectable value. Default: `0`.
maxnumber100Maximum selectable value. Default: `100`.
stepnumber10Step interval for snapping. Default: `10`.
prefixstring""Text before each formatted endpoint.
suffixstring""Text after each formatted endpoint.
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.
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-changeVuRangeChangeDetailCommitted or live range update.
vu-invalidVuRangeInvalidDetailWhen validation messages are recomputed.
vu-clearVuRangeClearDetailAfter `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 (`.range-track`) with variant chrome.
valueFormatted `from`–`to` summary.
affixPrefix or suffix text in the value summary.
highlightSelected range segment.
thumb-fromLower native `<input type="range">`.
thumb-toUpper native `<input type="range">`.
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
setRange- Sets and normalizes the selected range; emits `vu-change`.
reset- Restores `defaultValue` and dispatches `vu-clear`.
validateInput- Runs validators and syncs validity.

Types

NameDefinition
VuRangeChangeDetail
{ from: number; to: number; }
VuRangeClearDetail
{ from: number; to: number; }
VuRangeInvalidDetail
{ errors: string[]; }
VuRangeRadius
"sm" | "md" | "lg" | "none" | "full"
VuRangeSize
"sm" | "md" | "lg"
VuRangeTone
"subtle" | "normal" | "strong"
VuRangeVariant
"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: Radio GroupEarlier in the sidebar
  • Next: SerialLater in the sidebar
  • All componentsBrowse the full index