Slider
Pick a number or range by dragging a thumb along a horizontal track.
Import Slider from kumo-svelte. Pass value with bind:value for controlled input, or defaultValue for an initial value. An array creates a range slider. Use min, max, and step to constrain values and disabled to disable interaction.
<script lang="ts">
import { Slider } from "#lib/components/slider/index.js";
</script>
<div class="w-full max-w-sm space-y-6">
<Slider label="Volume" defaultValue={40} /><Slider
label="Price"
defaultValue={[25, 75]}
getAriaLabel={(index) => (index === 0 ? "Minimum price" : "Maximum price")}
/><Slider label="Match count" size="sm" max={5} defaultValue={2} /><Slider
label="Disabled"
disabled
defaultValue={50}
/>
</div> Both size="sm" and size="base" are supported. format and locale use Intl.NumberFormat for value badges and accessible value text. Provide label or getAriaLabel(index) so every thumb has a name. onValueChange runs during interaction and onValueCommitted runs when the interaction finishes. The layout supports horizontal orientation only. thumbAlignment="edge" maps to Bits UI contained thumbs; "center" maps to exact positioning.
Provide aria-label or aria-labelledby when there is no visible label. For ranges, getAriaLabel(index) can name each thumb separately. Pass name to submit the value with a form, and form for an external form ID. Native form reset restores the initial value. Scalar and range bindings preserve their respective callback types.