Slider Primitive
An input allowing the user to choose a value from a specified range.
Installation
Install the component via your command line.
Install @radix-ui/react-slider
Copy/paste the following code for web to ~/components/primitives/slider/slider.web.tsx
Copy/paste the following code for native to ~/components/primitives/slider/slider.tsx
Copy/paste the following code for types to ~/components/primitives/slider/types.ts
Copy/paste the following code for exporting to ~/components/primitives/slider/index.ts
Copy/paste the following code for native to ~/components/primitives/slider/index.tsx
Copy/paste the following code for types to ~/components/primitives/slider/types.ts
Usage
Props
Root
Extends View
props
Prop | Type | Note |
---|---|---|
value | number | (optional) |
disabled | boolean | (optional) |
min | number | (optional) |
max | number | (optional) |
dir | ’ltr’ | ‘rtl’ | Web Only (optional) |
inverted | boolean | Web Only (optional) |
step | number | Web Only (optional) |
onValueChange | (value: string[] ) => void | Web Only (optional) |
Track
Extends View
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |
Range
Extends View
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |
Thumb
Extends View
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |