Slider
An input where the value is within a set range.
Basic Example
<script lang="ts">
import { Slider, SliderRange, SliderThumb } from 'lithesome';
let value = $state(20);
</script>
<Slider bind:value>
<SliderRange />
<SliderThumb />
</Slider>
API Reference
<Slider />
| Property | Type | Description |
|---|---|---|
value | number | The current value. |
min | number | The minimum value. |
max | number | The maximum value. |
step | number | The steps between the `min` and `max` props. |
orientation | 'horizontal' | 'vertical' | The direction in which the slider will be used. |
reverse | boolean | Reverse the logic of the `orientation`. |
disabled | boolean | Disables the entire group, stops all events from firing. |
ref | E | The reference to the underlying element. |
children | Snippet<[ S extends Record<string, any> ? S : never ]> | The default snippet to render. |
custom | Snippet<[ S extends Record<string, any> ? { props: P; state: S; } : { props: P; } ]> | Snippet to be used when wanting a custom implementation. This will tell Lithesome not the render the default element and any state along with it. |
| State | Type | Description |
|---|---|---|
value | number | The current value. |
percentage | number | The current percentage from 0 to 100. |
<SliderThumb />
| Property | Type | Description |
|---|---|---|
ref | E | The reference to the underlying element. |
children | Snippet<[ S extends Record<string, any> ? S : never ]> | The default snippet to render. |
custom | Snippet<[ S extends Record<string, any> ? { props: P; state: S; } : { props: P; } ]> | Snippet to be used when wanting a custom implementation. This will tell Lithesome not the render the default element and any state along with it. |
| State | Type | Description |
|---|---|---|
value | number | The current value. |
percentage | number | The current percentage from 0 to 100. |
<SliderRange />
| Property | Type | Description |
|---|---|---|
ref | E | The reference to the underlying element. |
children | Snippet<[ S extends Record<string, any> ? S : never ]> | The default snippet to render. |
custom | Snippet<[ S extends Record<string, any> ? { props: P; state: S; } : { props: P; } ]> | Snippet to be used when wanting a custom implementation. This will tell Lithesome not the render the default element and any state along with it. |
| State | Type | Description |
|---|---|---|
value | number | The current value. |
percentage | number | The current percentage from 0 to 100. |
<SliderValue />
| Property | Type | Description |
|---|---|---|
ref | E | The reference to the underlying element. |