Import
Usage
Props
Minimum value. Default: 0.
Maximum value. Default: 100.
Controlled value.
Uncontrolled default value.
Unit label shown at min/max (e.g.,
"€", "kg", "%").Callback fired when slider value changes.
Color for filled portion of slider track. Default: primary blue.
Color for unfilled portion of slider track. Default: primary low (light blue).
Color for heart icon thumb. Default: primary blue.
Hide floating value tooltip above thumb.
Hide min/max labels below slider.
presents
Array<{ value: number; icon: ComponentType; color: string; colorSuccess: string; onClick?: () => void }>
Milestone markers with Lottie animation when reached.
value: Value at which to show markericon: Lucide icon component (not string)color: Color when milestone not reachedcolorSuccess: Color when milestone reached (slider value ≥ milestone value)onClick: Optional callback when marker is clicked
Custom CSS properties for the container.
Accepts all standard HTML input[type=“range”] attributes via
ComponentPropsWithoutRef<"input">.Features
Heart Icon Thumb
- Size: 44x44px
- White border: 2px
- Heart icon: White SVG from Adopta un Abuelo CDN
- Drop shadow: Subtle 2px shadow
- Active animation: Scales to 1.1 when dragging
Floating Value Bubble
- Position: Above thumb, follows slider movement
- Background: Neutral low gray
- Font: Poppins, 12px
- Arrow: Points down to thumb
- Can be hidden with
hideRangeprop
Milestone “Presents”
- Appear at specific values: Position calculated from slider width
- Two states:
- Inactive: Uses
colorprop - Active: Uses
colorSuccessprop when value ≥ milestone value
- Inactive: Uses
- Lottie animation: “pop.json” plays when milestone is reached
- Lift effect: Active markers translate -8px upward
- Hover scale: Grows to 1.2x on hover
- Dot indicator: Small 10px circle below icon
- Wobble animation: 2s rotation animation on initial render
Min/Max Labels
- Position: Below slider track
- Font: Poppins p2, neutral medium color
- Display: Shows “[min] [unit]” and “[max] [unit]”
- Can be hidden with
hideLabelsprop
Examples
Basic Slider
Donation Slider with Goals
Age Selector
Custom Colors
Progress Bar (Read-only)
No Floating Bubble
Styling Track
The slider track uses a CSS gradient to show filled/unfilled portions:Present Position Calculation
Browser Compatibility
- Chrome/Edge: Full support
- Firefox: Uses
-moz-range-thumb - Safari: Uses
-webkit-slider-thumb - Custom styling: Works across modern browsers
Accessibility
- Semantic
<input type="range"> - Keyboard navigation: Arrow keys to adjust value
- Screen reader support: Announces current value
- ARIA attributes inherited from native range input
Performance Notes
- Lottie animations: Only play when milestone is reached
- Canvas rendering: Used for smooth gradient updates
- Width calculation: Uses
useRefanduseEffectto measure slider width - Debouncing: Consider debouncing
onChangefor expensive operations