Skip to content

Commit 2539388

Browse files
docs(ui): added slider docs
1 parent d9d293b commit 2539388

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

apps/docs/app/docs/components/radio/page.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ This component is built on top of [Radix Radio Group](https://www.radix-ui.com/p
126126
| ---------- | -------------------------------------------------------- | -------------------------- | ------- |
127127
| size | Size of the radio group component and its subcomponents. | `"sm"` or `"md"` or `"lg"` | `"md"` |
128128
| isDisabled | To manage disabled state. | `boolean` | `false` |
129+
| isReadOnly | To manage readonly state. | `boolean` | `false` |
129130

130131
### RadioGroupItem
131132

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: Slider
3+
nextjs:
4+
metadata:
5+
title: Slider
6+
description: An input where the user selects a value from within a given range.
7+
twitter:
8+
title: Slider
9+
images:
10+
url: https://rafty.rhinobase.io/api/og?title=Slider
11+
openGraph:
12+
title: Slider
13+
images:
14+
url: https://rafty.rhinobase.io/api/og?title=Slider
15+
---
16+
17+
An input where the user selects a value from within a given range.
18+
19+
This component is made on top of [Radix UIs Slider Component](https://www.radix-ui.com/primitives/docs/components/slider) with our styling conventions. This component has been shared with you, ensuring that all its native properties are accessible.
20+
21+
## Anatomy
22+
23+
Import the component.
24+
25+
```jsx
26+
import { Slider, SliderRange, SliderThumb, SliderTrack } from "@rafty/ui";
27+
28+
<Slider>
29+
<SliderTrack>
30+
<SliderRange />
31+
</SliderTrack>
32+
<SliderThumb />
33+
</Slider>;
34+
```
35+
36+
## ColorScheme
37+
38+
There are 5 `colorScheme` options in badge: `primary` (default), `secondary`, `error`, `info`, `success` & `warning`.
39+
40+
{% example %}
41+
42+
```jsx
43+
<Slider colorScheme="secondary" defaultValue={[20]}>
44+
<SliderTrack>
45+
<SliderRange />
46+
</SliderTrack>
47+
<SliderThumb />
48+
</Slider>
49+
```
50+
51+
{% /example %}
52+
53+
## Size
54+
55+
There are 3 `size` options available: `sm`, `md` (default) & `lg`
56+
57+
{% example %}
58+
59+
```jsx
60+
<Slider size="sm" defaultValue={[20]}>
61+
<SliderTrack>
62+
<SliderRange />
63+
</SliderTrack>
64+
<SliderThumb />
65+
</Slider>
66+
```
67+
68+
{% /example %}
69+
70+
## Range Slider
71+
72+
{% example %}
73+
74+
```jsx
75+
<Slider defaultValue={[20, 80]}>
76+
<SliderTrack>
77+
<SliderRange />
78+
</SliderTrack>
79+
<SliderThumb />
80+
<SliderThumb />
81+
</Slider>
82+
```
83+
84+
{% /example %}
85+
86+
## Props
87+
88+
---
89+
90+
### Slider
91+
92+
This component is built on top of [Radix Slider](https://www.radix-ui.com/primitives/docs/components/slider#root).
93+
94+
| Property | Description | Type | Default |
95+
| ----------- | ------------------------------------- | ----------------------------------------------------------------------------------- | ----------- |
96+
| size | Size of the Slider component. | `"sm"` or `"md"` or `"lg"` | `"md"` |
97+
| colorScheme | Color Scheme of the Slider component. | `"primary"` or `"secondary"` or `"error"` or `"success"` or `"warning"` or `"info"` | `"primary"` |
98+
| isDisabled | To manage disabled state. | `boolean` | `false` |
99+
| isReadOnly | To manage readonly state. | `boolean` | `false` |
100+
101+
### SliderTrack
102+
103+
This component is built on top of [Radix Slider Track](https://www.radix-ui.com/primitives/docs/components/slider#track).
104+
105+
### SliderRange
106+
107+
This component is built on top of [Radix Slider Range](https://www.radix-ui.com/primitives/docs/components/slider#range).
108+
109+
### SliderThumb
110+
111+
This component is built on top of [Radix Slider Thumb](https://www.radix-ui.com/primitives/docs/components/slider#thumb).

apps/docs/lib/navigation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ export const navigation = [
132132
title: "Skeleton",
133133
href: "/docs/components/skeleton",
134134
},
135+
{
136+
title: "Slider",
137+
href: "/docs/components/slider",
138+
},
135139
{
136140
title: "Spinner",
137141
href: "/docs/components/spinner",

0 commit comments

Comments
 (0)