1
1
---
2
2
title : Range Slider
3
- package : " @chakra-ui/slider"
3
+ package : ' @chakra-ui/slider'
4
4
version : 1.6.9
5
- image : " components/range-slider.svg"
5
+ image : ' components/range-slider.svg'
6
+ description :
7
+ ' The RangeSlider is a multi thumb slider used to select a range of related
8
+ values.'
6
9
---
7
10
8
11
The ` RangeSlider ` is a multi thumb slider used to select a range of related
9
12
values. A common use-case of this component is a price range picker that allows
10
13
a user to set the minimum and maximum price.
11
14
12
15
<ComponentLinks
13
- theme = { { componentName: " slider" }}
14
- github = { { package: " slider" }}
15
- npm = { { package: " @chakra-ui/slider" }}
16
+ theme = { { componentName: ' slider' }}
17
+ github = { { package: ' slider' }}
18
+ npm = { { package: ' @chakra-ui/slider' }}
16
19
/>
17
20
18
21
<carbon-ad ></carbon-ad >
@@ -33,7 +36,7 @@ import {
33
36
RangeSliderTrack ,
34
37
RangeSliderFilledTrack ,
35
38
RangeSliderThumb ,
36
- } from " @chakra-ui/react"
39
+ } from ' @chakra-ui/react' ;
37
40
```
38
41
39
42
## Usage
@@ -42,7 +45,7 @@ import {
42
45
> provide an accessible label for the Slider.
43
46
44
47
``` jsx
45
- < RangeSlider aria- label= {[" min" , " max" ]} defaultValue= {[10 , 30 ]}>
48
+ < RangeSlider aria- label= {[' min' , ' max' ]} defaultValue= {[10 , 30 ]}>
46
49
< RangeSliderTrack>
47
50
< RangeSliderFilledTrack / >
48
51
< / RangeSliderTrack>
@@ -58,8 +61,8 @@ You can override the color scheme of the slider to any color key specified in
58
61
59
62
``` jsx
60
63
< RangeSlider
61
- aria- label= {[" min" , " max" ]}
62
- colorScheme= " pink"
64
+ aria- label= {[' min' , ' max' ]}
65
+ colorScheme= ' pink'
63
66
defaultValue= {[10 , 30 ]}
64
67
>
65
68
< RangeSliderTrack>
@@ -77,11 +80,11 @@ it vertical, pass the `orientation` prop and set its value to `vertical`.
77
80
78
81
``` jsx
79
82
< RangeSlider
80
- aria- label= {[" min" , " max" ]}
81
- colorScheme= " pink"
83
+ aria- label= {[' min' , ' max' ]}
84
+ colorScheme= ' pink'
82
85
defaultValue= {[10 , 30 ]}
83
- orientation= " vertical"
84
- minH= " 32 "
86
+ orientation= ' vertical'
87
+ minH= ' 32 '
85
88
>
86
89
< RangeSliderTrack>
87
90
< RangeSliderFilledTrack / >
@@ -97,15 +100,15 @@ it vertical, pass the `orientation` prop and set its value to `vertical`.
97
100
customize its styles.
98
101
99
102
``` jsx
100
- < RangeSlider aria- label= {[" min" , " max" ]} defaultValue= {[30 , 80 ]}>
101
- < RangeSliderTrack bg= " red.100" >
102
- < RangeSliderFilledTrack bg= " tomato" / >
103
+ < RangeSlider aria- label= {[' min' , ' max' ]} defaultValue= {[30 , 80 ]}>
104
+ < RangeSliderTrack bg= ' red.100' >
105
+ < RangeSliderFilledTrack bg= ' tomato' / >
103
106
< / RangeSliderTrack>
104
107
< RangeSliderThumb boxSize= {6 } index= {0 }>
105
- < Box color= " tomato" as= {MdGraphicEq} / >
108
+ < Box color= ' tomato' as= {MdGraphicEq} / >
106
109
< / RangeSliderThumb>
107
110
< RangeSliderThumb boxSize= {6 } index= {1 }>
108
- < Box color= " tomato" as= {MdGraphicEq} / >
111
+ < Box color= ' tomato' as= {MdGraphicEq} / >
109
112
< / RangeSliderThumb>
110
113
< / RangeSlider>
111
114
```
@@ -117,8 +120,8 @@ accomplished using the `step` prop.
117
120
118
121
``` jsx
119
122
< RangeSlider defaultValue= {[120 , 240 ]} min= {0 } max= {300 } step= {30 }>
120
- < RangeSliderTrack bg= " red.100" >
121
- < RangeSliderFilledTrack bg= " tomato" / >
123
+ < RangeSliderTrack bg= ' red.100' >
124
+ < RangeSliderFilledTrack bg= ' tomato' / >
122
125
< / RangeSliderTrack>
123
126
< RangeSliderThumb boxSize= {6 } index= {0 } / >
124
127
< RangeSliderThumb boxSize= {6 } index= {1 } / >
@@ -133,7 +136,7 @@ interested in the final result after sliding is complete. You can use
133
136
134
137
``` jsx live=false
135
138
< RangeSlider
136
- aria- label= {[" min" , " max" ]}
139
+ aria- label= {[' min' , ' max' ]}
137
140
onChangeEnd= {(val ) => console .log (val)}
138
141
>
139
142
< RangeSliderTrack>
@@ -157,7 +160,7 @@ The `RangeSlider` component wraps all its children in the
157
160
[ Box] ( /docs/layout/box ) component, so you can pass all ` Box ` props to change its
158
161
style.
159
162
160
- <PropsTable of = " RangeSlider" />
163
+ <PropsTable of = ' RangeSlider' />
161
164
162
165
### RangeSliderThumb Props
163
166
0 commit comments