Slider
Pick a value or a range.
Import
tsx
import { Slider } from "@cronus-ui/ui";
bash
npx cronus-ui add slider
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
half.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component SliderHalf layout:inline style:slider {
value:50
aria-label:"Volume"
label "Volume"
}
page "/audit/slider/half" type:custom {
use SliderHalf
}
API Reference
Generated from the component's exported types.
SliderProps
Extends ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
| Prop | Type | Default | Description |
|---|---|---|---|
value | number[] | — | Controlled thumbs. Pair with `onValueChange`. |
defaultValue | number[] | — | Uncontrolled initial thumbs. |
onValueChange | (value: number[]) => void | — | Called when the value changes. |
onValueCommit | (value: number[]) => void | — | Called when a thumb is released. |
min | number | 0 | — |
max | number | 100 | — |
step | number | 1 | — |
disabled | boolean | — | Disables pointer and keyboard interaction. |
orientation | "horizontal" | "vertical" | — | — |
dir | "ltr" | "rtl" | — | Reading direction. Inherits from the document when omitted. |
name | string | — | Submitted name when used in a form. |