-
Notifications
You must be signed in to change notification settings - Fork 24
/
Slider.jsx
52 lines (48 loc) · 962 Bytes
/
Slider.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { Slider } from 'antd';
import type { SliderMarks } from 'antd/es/slider';
import React from 'react';
const style: React.CSSProperties = {
display: 'inline-block',
height: 500,
marginLeft: 80,
};
const marks: SliderMarks = {
0: {
style: {
color: '#008cff',
},
label: <strong>0°C</strong>,
},
20: {
style: {
color: '#00ffae',
},
label: <strong>20°C</strong>,
},
50: {
style: {
color: '#ff00aa',
},
label: <strong>50°C</strong>,
},
100: {
style: {
color: '#ff0004',
},
label: <strong>100°C</strong>,
},
};
const App: React.FC = () => (
<>
<div style={style}>
<Slider vertical defaultValue={30} />
</div>
<div style={style}>
<Slider vertical range step={20} defaultValue={[30, 80]} />
</div>
<div style={style}>
<Slider vertical range marks={marks} defaultValue={[20, 50]} />
</div>
</>
);
export default App;