Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 4d01568

Browse files
scharingerTigge
authored andcommitted
fix(docs): update slider docs
Add describing label to the last slider and add ticks information.
1 parent 01ff635 commit 4d01568

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/docs/src/mdx/coreComponents/Slider.mdx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const DemoComponent = () => {
2525
const [valueField, setValueField] = useState(0)
2626
const [valueFieldUnitLabel, setValueFieldUnitLabel] = useState(0)
2727
const [metaSliderValue, setMetaSliderValue] = useState(0)
28+
const [ticksSnapSliderValue, setTicksSnapSliderValue] = useState(0)
2829
const [ticksOnlySliderValue, setTicksOnlySliderValue] = useState(0)
2930
return (
3031
<>
@@ -47,11 +48,11 @@ export const DemoComponent = () => {
4748
/>
4849
<SpaceBlock variant={16} />
4950
<SliderField
50-
label="Tick slider field"
51+
label="Slider field with ticks"
5152
min={-10}
5253
max={20}
53-
value={ticksOnlySliderValue}
54-
handleChange={setTicksOnlySliderValue}
54+
value={ticksSnapSliderValue}
55+
handleChange={setTicksSnapSliderValue}
5556
compact={true}
5657
tickConfig={{
5758
ticks: [
@@ -60,15 +61,16 @@ export const DemoComponent = () => {
6061
{ position: 10, label: '10°', marker: true },
6162
{ position: 20, label: '20°', marker: true },
6263
],
63-
snap: false,
6464
}}
6565
/>
6666
<SpaceBlock variant={16} />
67-
<Slider
67+
<SliderField
68+
label="Slider field with ticks where `snap` prop set to false"
6869
min={-20}
6970
max={20}
70-
value={metaSliderValue}
71-
handleChange={setMetaSliderValue}
71+
value={ticksOnlySliderValue}
72+
handleChange={setTicksOnlySliderValue}
73+
compact={true}
7274
tickConfig={{
7375
ticks: [
7476
{ position: -20, label: '-20°', marker: true },
@@ -77,7 +79,7 @@ export const DemoComponent = () => {
7779
{ position: 10, label: '10°', marker: true },
7880
{ position: 20, label: '20°', marker: true },
7981
],
80-
snap: true,
82+
snap: false,
8183
}}
8284
/>
8385
</>

0 commit comments

Comments
 (0)