Slider

An input where the user selects a value from within a given range.

Usage

HTML + JavaScript

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.

<script src="https://cdn.jsdelivr.net/npm/basecoat-css@1.0.0/dist/js/basecoat.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/basecoat-css@1.0.0/dist/js/range.min.js" defer></script>
<input type="range" class="input w-full" min="0" max="100" value="50" />

HTML structure

<input type="range" class="input">
Native range input styled as a slider. Width utilities such as 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.

Examples

Default

Controlled Label

50

Disabled

RTL