--- layout: layouts/component.njk title: Slider description: An input where the user selects a value from within a given range. toc: - label: Usage id: usage --- {% from "macros/code_preview.njk" import code_preview %} {% from "macros/code_block.njk" import code_block %} {% set code %}{% endset %} {{ code_preview("slider", code, "w-full max-w-sm") }}

Usage

You can style an <input type="range"> element by either adding the input class or having a parent with the form class (read more about form). However, the range input also requries some Javacript code to be able to paint the left side of the slider.

{{ code_block(code) }}