Range Input
The catnip-range-input custom element lets users choose a numeric value within a known range. It uses the same integrated label and supporting-text patterns as Input, Number Input, and the shared Inputs overview.
Overview
- Value (
v-model):model-value/.modelValueis a number. - Bounds:
minandmaxdefine the selectable range. Defaults are0and100. - Step:
stepcontrols keyboard and pointer increments. Default is1. - Sizes:
sizesupportsmandl, matching the available Figma variants. - Native control: The component uses
input[type="range"]internally, so pointer, touch, and keyboard behaviour follow the platform. - Value tooltip: The current value appears above the thumb while the slider is hovered, focused, or being dragged. Set
showValueTooltipto keep it visible at all times. - Validation copy: The component does not generate error messages. Consumers pass dynamic validation copy through
supportingTextand setintentto match the state. - Forms: The current numeric value is submitted when
nameis set.
Live example
Guidelines
Use catnip-range-input when a value is best chosen by relative position inside a bounded range, for example percentages, volume, confidence, or intensity.
Behaviour
- Use clear
min,max, andstepvalues. Avoid a range input when the exact value is more important than the relative position; use Number Input instead. - Choose
size="m"orsize="l"according to the surrounding field density. Range Input does not provide an S variant. - Keep labels visible. A range without a label is difficult to understand, especially when several sliders appear together.
- Use
show-min-max-labelswhen the endpoints help users interpret the scale. - Use
show-value-tooltiponly when the exact value should remain visible at rest. Otherwise the component shows the value while hovered, focused, or dragged, which covers mouse, keyboard, touch, and pointer interaction without adding constant visual noise. - Use
show-input-fieldonly when users may need to enter an exact value.
Intents and status
The intent prop matches other field components: neutral, warning, danger, and success. It is reflected in supporting text and the optional value input, while the slider track and thumb remain neutral/primary.
Validation messages are consumer-owned. When a value violates a product rule, set intent="danger" and pass the same dynamic copy through supportingText. The component will expose that supporting text through aria-describedby, but it will not create, replace, or translate the message for you.