The Elastic Slider is a high-performance Framer component built with Framer Motion to provide a tactile, playful user experience. Unlike standard range inputs, this component features a "decay" algorithm that allows the slider to stretch elastically when dragged beyond its minimum or maximum bounds, snapping back with a satisfying spring physics animation.
Key Features:
Elastic Overflow: Uses a sigmoid-based decay function to simulate physical resistance when reaching the track limits.
Dynamic Scaling: The slider track and icons react to hover and drag states, providing immediate visual feedback.
Precision Control: Supports both fluid movement and Stepped increments via a toggleable stepSize property.
Fully Customizable: Easily adjust colors for the track, range, and UI icons, plus toggleable numeric labels with adjustable font sizes.
Built-in Layout: Designed to be responsive and center-aligned, fitting perfectly into any side panel or dashboard interface.
Copy the code for the ElasticSlider component.
In your Framer project, create a new Code Component.
Paste the code, save it, and drag the component onto your canvas.
Use the Properties Panel on the right to customize the slider:
Values: Set your Min, Max, and Default starting points.
Stepped Mode: Enable "Stepped" if you want the slider to snap to specific intervals (like 0, 10, 20).
Styling: Change the Range color (the filled part) and the Track color (the background).
Label: Toggle "Show Label" to display the current numeric value below the slider.
Hover: The slider will slightly scale up to indicate it is interactive.
Drag: Click and drag the track to change the value.
Stretch: Drag past the icons to see the "elastic" stretch effect.