Skip to content

Range Input

Shared label and supporting-text behaviour is summarised on Inputs overview.

catnip-range-input

Props

Value & constraints

PropTypeDefaultDescription
modelValuenumber50Numeric value; model-value in HTML / .modelValue in frameworks.
minnumber0Minimum selectable value.
maxnumber100Maximum selectable value.
stepnumber1Increment used by pointer, touch, and keyboard interactions.

Field presentation

PropTypeDefaultOptionsDescription
labelstring""Visible label text when the label slot is empty.
optionalbooleanfalseShows optional hint on the label when not required.
optionalTextstring""Overrides optional hint text (HTML: optional-text).
infostring""Info tooltip on the label (info wins over the label.suffix slot when both are set).
alignmentstring"left"left, center, rightLabel alignment.
requiredMarkerstring"*"Visual required marker (HTML: required-marker).
requiredScreenReaderTextstring""Supplemental screen-reader text for required fields (HTML: required-screen-reader-text).
supportingTextstring | string[] | { text, intent?, icon? } | { text, intent?, icon? }[]""Consumer-provided message(s) below the field. Pass dynamic validation copy here; the range input does not generate error messages.

Range presentation

PropTypeDefaultDescription
showMinMaxLabelsbooleantrueShows the min and max labels beside the slider.
minLabelstring""Custom min label. Falls back to min.
maxLabelstring""Custom max label. Falls back to max.
alwaysShowValueTooltipbooleanfalseAlways shows the current value above the thumb. When false, the value tooltip still appears while the range is hovered, focused, or being dragged.
showInputFieldbooleanfalseShows an optional numeric input bound to the same value. Invalid typed drafts use danger styling while editing.
valueInputAriaLabelstring""Accessible name for the optional numeric value input.

State

PropTypeDefaultOptionsDescription
sizestring"m"s, m, lDimensions and typography. Figma currently defines M and L; S follows the compact field scale.
intentstring"neutral"neutral, warning, danger, successConsumer-driven status for supporting text and the optional value input. The slider track/thumb remain neutral/primary.
disabledbooleanfalseDisables the range and optional value input.
readonlybooleanfalsePrevents user changes while keeping the control focusable.
requiredbooleanfalseNative required and label marker.
ariaLabelstring""aria-label when there is no visible label.
ariaDescribedbystring""Extra id values merged into aria-describedby.

Advanced

PropTypeDefaultDescription
idstring""DOM id for the range input. Auto-generated when omitted.
namestring""Native name for form submission.
autofocusbooleanfalseAutofocus (use sparingly).
hideLabelbooleanfalseHides the built-in label row.
testSelectorsobjectSee Test selectorsOverrides for data-test.

Events

NamePayloadDescription
update:modelValuenumberValue changed.

Slots

NameDescription
labelCustom label content; falls back to label prop.
label.actionTrailing action in the label row.
label.suffixCustom label suffix; used only when info is empty.

Test selectors

AttributeDefaultApplies to
rootcatnip-range-inputField wrapper
controlcatnip-range-input-controlNative range input
minLabelcatnip-range-input-min-labelMinimum label
maxLabelcatnip-range-input-max-labelMaximum label
valueTooltipcatnip-range-input-value-tooltipCurrent value tooltip
valueInputcatnip-range-input-value-inputOptional numeric value input
supportingTextcatnip-range-input-supporting-textSupporting message

Catnip Design System by Signicat