Slider
choose a numeric value by moving the range or using its keyboard controls. add ticks for meaningful destinations, or a numeric editor when someone already knows the value.
20 minutes
usage
<script lang="ts">
import { Slider } from '@ciabi/loafkit-ui';
let minutes = $state(20);
</script>
<Slider label="daily reading goal" name="minutes" min={5} max={60} step={5} bind:value={minutes} />
<p role="status">{minutes} minutes</p>use a visible label and units that fit the task. the range input submits its value under name; your app still owns the form and its saved result.
tick destinations and a numeric editor
session: 20 minutes
<script lang="ts">
import { Slider } from '@ciabi/loafkit-ui';
let sessionMinutes = $state(20);
</script>
<Slider label="reading session minutes" variant="bulky" min={5} max={60} step={5}
showInput bind:value={sessionMinutes} ticks={[{value:5,label:'quick note'},{value:20,label:'one article'},{value:60,label:'a free hour'}]} />
<p role="status">session: {sessionMinutes} minutes</p>API reference
Tick describes the local object shape, not a separately exported type. native input attributes other than type/value/min/max/step are forwarded to the range; class/style affect the wrapper.
Slider
value- Default:
0the bindable numeric value.
min- Default:
0the start of the range.
max- Default:
1the end of the range; must exceed min.
step- Default:
'any'the value increment for native keyboard and numeric commits.
ticks- Default:
[]visible destinations selected by the nearest pointer position.
variant- Default:
'default'the track presentation.
label-
visible heading and range accessible name.
showInput- Default:
falseshows a numeric editor alongside the label.
background-
custom track background; makes the progress background transparent.
class- Default:
''extra classes on the slider wrapper.
style-
inline styles on the slider wrapper.
Tick
one tick supplied to Slider; this local shape is not a package export.