Slider
Range slider input with themed track and fill
Same BEM classes and behavior as Astro, Svelte, and Vue.
Add this component
The command below includes <strong>Slider</strong>—run it in your project directory to install this component (and the CSS if needed). No prompts.
Choose your package manager — click a tab to select, then copy the command.
pnpm dlx rizzo-css add Slider
bunx rizzo-css add Slider
Live examples
Usage
Usage
Full example for each framework (Astro, Vanilla, Svelte, Vue, React). Switch framework via View as or by clicking a Usage tab—both stay in sync.
Astro Vanilla Svelte Vue React ---
import Slider from '../components/astro/Slider.astro';
---
<Slider min={0} max={100} value={50} ariaLabel="Volume" client:load />
<!-- Rizzo CSS. BEM: slider, slider__track, slider__fill; input type="range" inside. -->
<div class="slider">
<div class="slider__track"><div class="slider__fill" style="width: 50%;"></div></div>
<input type="range" min="0" max="100" value="50" aria-label="Value" />
</div>
<script>
import { Slider } from '$lib/rizzo';
let value = $state(50);
</script>
<Slider min={0} max={100} bind:value ariaLabel="Volume" />
<script setup>
import { ref } from 'vue';
import Slider from '@/components/rizzo/Slider.vue';
</script>
<template>
<Slider
v-model:value="value"
:min="0"
:max="100"
aria-label="Volume"
/>
</template>
import { useState } from 'react';
import { Slider } from './components/react';
const [value, setValue] = useState(50);
<Slider
min={0}
max={100}
value={value}
onValueChange={setValue}
ariaLabel="Volume"
/>
Other frameworks: Astro · Vanilla · Svelte · Vue