@@ -19,15 +19,15 @@ const sections = getSections({
1919 <h1 >Slider</h1 >
2020 <div class =" grid md-2 lg-3" >
2121 <ComponentWrapper type =" Astro" >
22- <AstroSlider min = { 0 } max = { 100 } value ={ 50 } />
22+ <AstroSlider value ={ 50 } />
2323 </ComponentWrapper >
2424
2525 <ComponentWrapper type =" Svelte" >
26- <SvelteSlider min = { 0 } max = { 100 } value ={ 50 } />
26+ <SvelteSlider value ={ 50 } />
2727 </ComponentWrapper >
2828
2929 <ComponentWrapper type =" React" >
30- <ReactSlider min = { 0 } max = { 100 } value ={ 50 } />
30+ <ReactSlider value ={ 50 } />
3131 </ComponentWrapper >
3232 </div >
3333
@@ -38,26 +38,22 @@ const sections = getSections({
3838 </Fragment >
3939 <div class = " grid md-2 lg-3" >
4040 <ComponentWrapper title = " Default with no value" >
41- <section.component min = { 0 } max = { 100 } />
41+ <section.component />
4242 </ComponentWrapper >
4343
4444 <ComponentWrapper title = " With default value" >
45- <section.component min = { 0 } max = { 100 } value = { 33 } />
45+ <section.component value = { 33 } />
4646 </ComponentWrapper >
4747
4848 <ComponentWrapper title = " With steps" >
4949 <section.component
50- min = { 0 }
51- max = { 100 }
5250 step = { 20 }
5351 value = { 20 }
5452 />
5553 </ComponentWrapper >
5654
5755 <ComponentWrapper title = " With custom colors" >
5856 <section.component
59- min = { 0 }
60- max = { 100 }
6157 value = { 50 }
6258 color = " var(--w-color-success)"
6359 background = " var(--w-color-primary-60)"
@@ -68,8 +64,6 @@ const sections = getSections({
6864 <ComponentWrapper title = " With label" >
6965 <div class = " flex items-center xs" >
7066 <section.component
71- min = { 0 }
72- max = { 100 }
7367 value = { 20 }
7468 className = " labelled"
7569 />
@@ -80,21 +74,29 @@ const sections = getSections({
8074 <ComponentWrapper title = " With label on top" >
8175 <span class = " muted" >40</span >
8276 <section.component
83- min = { 0 }
84- max = { 100 }
8577 value = { 40 }
8678 className = " labelled1"
8779 />
8880 </ComponentWrapper >
8981
9082 <ComponentWrapper title = " Disabled" >
9183 <section.component
92- min = { 0 }
93- max = { 100 }
9484 value = { 40 }
9585 disabled = { true }
9686 />
9787 </ComponentWrapper >
88+
89+ <ComponentWrapper title = " With custom min/max" >
90+ <div class = " flex items-center xs" >
91+ <section.component
92+ min = { - 100 }
93+ max = { 500 }
94+ value = { - 50 }
95+ className = " labelled2"
96+ />
97+ <span class = " muted" >-50</span >
98+ </div >
99+ </ComponentWrapper >
98100 </div >
99101 ))}
100102</Layout >
@@ -105,6 +107,7 @@ const sections = getSections({
105107 on(document, 'astro:page-load', () => {
106108 const slider1 = document.querySelector('.labelled')
107109 const slider2 = document.querySelector('.labelled1')
110+ const slider3 = document.querySelector('.labelled2')
108111
109112 slider1?.addEventListener('change', (e: any) => {
110113 e.target.nextElementSibling.innerText = e.target.value
@@ -113,5 +116,9 @@ const sections = getSections({
113116 slider2?.addEventListener('change', (e: any) => {
114117 e.target.previousElementSibling.innerText = e.target.value
115118 })
119+
120+ slider3?.addEventListener('change', (e: any) => {
121+ e.target.nextElementSibling.innerText = e.target.value
122+ })
116123 })
117124</script >
0 commit comments