01
See it and copy it
Framework example
Choose Astro, React, or Elements to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.
View Slider code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. React and Elements use their own behavior APIs; complete the matching framework setup before copying an example.---
import {
Label,
Slider
} from '@santi020k/lumen-astro'
---
<div style="display: grid; gap: 0.75rem; max-width: 20rem;">
<Label for="ex-slider-opacity">Opacity</Label>
<Slider id="ex-slider-opacity" name="opacity" min="0" max="100" value="80" aria-describedby="ex-slider-opacity-value" />
<output id="ex-slider-opacity-value" for="ex-slider-opacity" aria-live="polite">80</output>
<Label for="ex-slider-volume">Volume</Label>
<Slider id="ex-slider-volume" name="volume" min="0" max="100" step="5" value="45" />
</div>
<script>
const slider = document.querySelector<HTMLInputElement>('#ex-slider-opacity')
const output = document.querySelector<HTMLOutputElement>('#ex-slider-opacity-value')
if (slider && output) {
const updateValue = () => {
output.value = slider.value
output.textContent = slider.value
}
updateValue()
slider.addEventListener('input', updateValue)
}
</script>import {
Label,
Slider
} from '@santi020k/lumen-react'
export const Example = () => (
<>
<div style={{ "display": "grid", "gap": "0.75rem", "maxWidth": "20rem" }}>
<Label htmlFor="ex-slider-opacity">Opacity</Label>
<Slider id="ex-slider-opacity" name="opacity" min="0" max="100" defaultValue="80" aria-describedby="ex-slider-opacity-value" />
<output id="ex-slider-opacity-value" htmlFor="ex-slider-opacity" aria-live="polite">80</output>
<Label htmlFor="ex-slider-volume">Volume</Label>
<Slider id="ex-slider-volume" name="volume" min="0" max="100" step="5" defaultValue="45" />
</div>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<div style="display: grid; gap: 0.75rem; max-width: 20rem;">
<lumen-label for="ex-slider-opacity">Opacity</lumen-label>
<lumen-slider id="ex-slider-opacity" name="opacity" min="0" max="100" value="80" aria-describedby="ex-slider-opacity-value"></lumen-slider>
<output id="ex-slider-opacity-value" for="ex-slider-opacity" aria-live="polite">80</output>
<lumen-label for="ex-slider-volume">Volume</lumen-label>
<lumen-slider id="ex-slider-volume" name="volume" min="0" max="100" step="5" value="45"></lumen-slider>
</div>02
Choose your target
Add this component
Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.
pnpm add @santi020k/lumen-astroScroll horizontally to read more
lumen add SliderScroll horizontally to read more
pnpm add @santi020k/lumen-reactScroll horizontally to read more
lumen add Slider --target reactScroll horizontally to read more
pnpm add @santi020k/lumen-elementsScroll horizontally to read more
lumen add Slider --target elementsScroll horizontally to read more
API reference
Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.
Scroll horizontally to compare
| Attribute | Values | Default | Description |
|---|---|---|---|
| type | HTML input type | "range" | Sets the native input type. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
| ...native attributes | HTML attributes | - | Forwards standard attributes to the root element unless the component consumes them. |