Slider Edit
An input where the user selects a value from within a given range.
Examples
<%= render_slider name: "sample_slider",
id: "sample_slider",
value: 23,
class: "w-full" %>
Installation
rails generate shadcn-ui slider
Usage
<%= render_slider name: %>
The Slider component introduces:
app/helpers/components/slider_helper.rbapp/javascript/controllers/ui/slider_controller.jsapp/views/components/ui/_slider.html.erb
render_slider accepts one keyword argument for the name of the slider element. It optionally accepts a value keyword for the starting value of the slider.
The javascript controller is responsible for maintaining the state and visual of the slider from the underlying range input.