--- templateEngineOverride: njk layout: layouts/page.njk title: Slider description: An input where the user selects a value from within a given range. toc: - label: Usage id: usage children: - label: HTML + JavaScript id: usage-html-js - label: HTML structure id: usage-structure - label: Examples id: examples children: - label: Default id: example-default - label: Controlled Label id: example-controlled-label - label: Disabled id: example-disabled - label: RTL id: example-rtl --- {% 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") }}
Use a native <input type="range"> with the input class. Include range.js so Basecoat can keep the filled track in sync with the input value.
<input type="range" class="input">w-full can be added directly.Basecoat intentionally uses the native range input. Unlike shadcn/ui's Base UI slider, it does not support multiple thumbs or vertical orientation.