Slider
Numeric value selection via draggable handle. Supports single value and range (two handles) modes, step marks, and live value display. Works standalone or inside Rails forms with hidden inputs for submission.
Preview & Code
_slider.html.erb
███
██████ █████████ █████████
██████ █████
███ ██████ ████████████████████ ██████ █████████ ██████ ███ ███████████ ████ ██
█████ █████
███ ██████ ████████████████████ █████ ███████ ██████ ██████ ███████ ██████████ ███ ██████████ ███
█████████ ████████████ █████████ ████████████ ███████████ ████ ██
slider_controller.js
██████ █ ██████████ █ ████ ████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ █
████████
███████
████████
███████████
███████████
███████████████
slider_component.html.erb
████ ██████████ █████████████████ ███
████████████████████████
██████████████████████████ ████ ███
██████████████████████████ ████ ███
███████████████████████████ █████ ███
████████████████████████████ ██████ ██ █ ███
████████████████████████████████ ██████████ ███
████████████████████████████████ ██████████ ███
███████████████████████████ █████ ████
slider_component.rb
█ ██████████████████████ ████
█████ ███████████████ █ ███████████████████
███ ███████████
█████ ████████
████ ██
████ ████
█████ ██
██████ ████
██████████ ████
slider_controller.js
██████ █ ██████████ █ ████ ████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ █
████████
███████
████████
███████████
███████████
███████████████
Changelog
- Initial release with single and range modes
- Step marks support with auto-generation or custom label arrays
- Live value tooltip display above thumb(s)
- Keyboard navigation (Arrow keys, Home, End)
- Touch support for mobile devices
- Hidden inputs for Rails form submission
- Dark mode support with slate palette
Get Full Access
Unlock the source code for this component and all others. One-time payment for lifetime access.
Get Access Now