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 field label when the label slot is empty.
optionalbooleanfalse—When true and not required, shows the localized optional hint.
optionalTextstring""—Overrides the localized optional hint (HTML: optional-text).
infostring""—Info tooltip beside the label; when non-empty, it wins over the label.suffix slot.
alignment"left" | "center" | "right""left"left, center, rightHorizontal alignment of the field label block.
requiredMarkerstring"*"—Visual marker for required fields (HTML: required-marker).
requiredScreenReaderTextstring""—Optional screen-reader supplement; it does not replace required on the control (HTML: required-screen-reader-text).
supportingTextSupportingTextProp""—One or more helper or validation messages. Each object requires text; intent accepts neutral, danger, warning, or success, and icon accepts a Catnip icon name. See supporting-text examples.

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.
showValueTooltipbooleanfalseShows the current value above the thumb at rest. 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
size"m" | "l""m"m, lDimensions and typography.
intent"neutral" | "danger" | "warning" | "success""neutral"neutral, danger, warning, successSemantic state applied to field and supporting-text styling; danger sets aria-invalid on the active value control while the slider track and thumb keep their normal colors.
disabledbooleanfalse—Disables the range and optional value input.
readonlybooleanfalse—Prevents user changes while keeping the control focusable.
requiredbooleanfalse—Native required and label marker.
ariaLabelstring""—aria-label when there is no visible label.
ariaDescribedbystring""—Extra id values merged into aria-describedby alongside generated supporting-text ids.

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.
testSelectorsTestSelectorsPropSee Test selectorsOverrides stable data-test values.

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