{"slug":"slider","name":"Slider","category":"Form & Input","summary":"Selects a number, or a range, along a track.","status":"stable","since":"0.1.0","import":"import { Slider } from '@elluzion/iv-ui';","usage":["Bind `value`; set `range` for a `[start, end]` tuple.","`min`, `max`, and `step` define the scale; `tickMarks` sketches it.","`showValue` prints the current value next to the label."],"props":[{"name":"value","type":"number | [number, number]","default":"0","description":"Current value, or `[start, end]` when `range` is set.","required":false,"bindable":true},{"name":"range","type":"boolean","default":"false","description":"Renders two handles and a `[start, end]` value.","required":false,"bindable":false},{"name":"min","type":"number","default":"0","description":"Minimum value.","required":false,"bindable":false},{"name":"max","type":"number","default":"100","description":"Maximum value.","required":false,"bindable":false},{"name":"step","type":"number","default":"1","description":"Increment between values.","required":false,"bindable":false},{"name":"tickMarks","type":"boolean","default":"false","description":"Draws ticks at every step.","required":false,"bindable":false},{"name":"label","type":"string","default":"''","description":"Visible label and accessible name.","required":false,"bindable":false},{"name":"disabled","type":"boolean","default":"false","description":"Disables interaction and applies the disabled treatment.","required":false,"bindable":false},{"name":"showValue","type":"boolean","default":"false","description":"Shows the current value next to the label.","required":false,"bindable":false},{"name":"size","type":"'sm' | 'md'","default":"'md'","description":"Control size.","required":false,"bindable":false}],"events":[{"name":"change","type":"(e: CustomEvent<{ value: number | [number, number] }>) => void","default":null,"description":"Called with `{ value }` while the handle moves.","required":false,"bindable":false}],"snippets":[],"types":[],"manual":[],"tokens":["--iv_border","--iv_cursor","--iv_disabled-opacity","--iv_ease-in-out","--iv_font-mono","--iv_font-ui","--iv_foreground","--iv_foreground-dim","--iv_outline-width","--iv_radius-sm","--iv_ring","--iv_ring-width","--iv_slider-track","--iv_slider-track-sm","--iv_spacing-sm","--iv_surface-elevated","--iv_text-label","--iv_text-sm","--iv_thumb-md","--iv_transition-base"],"cssHooks":["iv-active","iv-disabled","iv-fill","iv-header","iv-label","iv-md","iv-root","iv-sm","iv-thumb","iv-tick","iv-ticks","iv-track","iv-value"],"accessibility":{"keyboard":[["Arrow keys","Change the value by one step."],["Home / End","Jump to the minimum or maximum."],["Tab","Moves between the handles in a range slider."]],"notes":["The track exposes `role=\"slider\"` with `aria-valuemin`, `aria-valuemax`, and `aria-valuenow`.","Range handles are labelled lower and upper; pass `label` to name the scale.","Values are clamped and snapped to `step` before they are emitted."]},"related":[{"title":"Input","summary":"A single-line text field with an optional label, helper, and error state.","url":"/components/input","kind":"Component"},{"title":"Progress","summary":"Shows how much of a task is complete.","url":"/components/progress","kind":"Component"},{"title":"Switch","summary":"An on/off control that applies immediately.","url":"/components/switch","kind":"Component"},{"title":"Field","summary":"Labels a custom control and renders its helper or error message.","url":"/components/field","kind":"Component"}],"examples":[{"id":"basic","title":"Basic","description":"A single handle with a visible value.","code":"<script lang=\"ts\">\n\timport { Slider } from '@elluzion/iv-ui';\n\n\tlet volume = $state(64);\n</script>\n\n<div class=\"field-row\">\n\t<Slider label=\"Volume\" bind:value={volume} showValue />\n</div>\n\n<style>\n\t.field-row {\n\t\twidth: 100%;\n\t\tmax-width: 360px;\n\t}\n</style>"},{"id":"range","title":"Range","description":"Two handles bound to a `[start, end]` tuple.","code":"<script lang=\"ts\">\n\timport { Slider } from '@elluzion/iv-ui';\n\n\tlet window = $state<[number, number]>([20, 80]);\n</script>\n\n<div class=\"field-row\">\n\t<Slider label=\"Retention window\" range bind:value={window} showValue />\n\t<p class=\"readout\">{window[0]} — {window[1]} days</p>\n</div>\n\n<style>\n\t.field-row {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: var(--iv_spacing-sm);\n\t\twidth: 100%;\n\t\tmax-width: 360px;\n\t}\n\n\t.readout {\n\t\tmargin: 0;\n\t\tfont-family: var(--iv_font-mono);\n\t\tfont-size: var(--iv_text-sm);\n\t\tcolor: var(--iv_foreground-dim);\n\t}\n</style>"},{"id":"ticks","title":"Ticks","description":"`step` and `tickMarks` expose the increments.","code":"<script lang=\"ts\">\n\timport { Slider } from '@elluzion/iv-ui';\n\n\tlet replicas = $state(3);\n</script>\n\n<div class=\"field-row\">\n\t<Slider label=\"Replicas\" min={1} max={9} step={1} tickMarks bind:value={replicas} showValue />\n</div>\n\n<style>\n\t.field-row {\n\t\twidth: 100%;\n\t\tmax-width: 360px;\n\t}\n</style>"},{"id":"disabled","title":"Disabled","description":"The track stays readable but cannot be moved.","code":"<script lang=\"ts\">\n\timport { Slider } from '@elluzion/iv-ui';\n\n\tlet quota = $state(70);\n</script>\n\n<div class=\"field-row\">\n\t<Slider label=\"Storage quota\" bind:value={quota} showValue disabled />\n</div>\n\n<style>\n\t.field-row {\n\t\twidth: 100%;\n\t\tmax-width: 360px;\n\t}\n</style>"}],"markdown":"/components/slider.md","page":"/components/slider"}