Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function EdgeAlignedThumb() {
<Slider.Control className={styles.Control}>
<Slider.Track className={styles.Track}>
<Slider.Indicator className={styles.Indicator} />
<Slider.Thumb className={styles.Thumb} />
<Slider.Thumb getAriaLabel={() => 'edge-aligned-thumb'} className={styles.Thumb} />
</Slider.Track>
</Slider.Control>
</Slider.Root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export default function EdgeAlignedThumb() {
<Slider.Control className="flex w-56 touch-none items-center py-3 select-none">
<Slider.Track className="h-1 w-full rounded bg-gray-200 shadow-[inset_0_0_0_1px] shadow-gray-200 select-none">
<Slider.Indicator className="rounded bg-gray-700 select-none" />
<Slider.Thumb className="size-4 rounded-full bg-white outline outline-1 outline-gray-300 select-none has-[:focus-visible]:outline has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-blue-800" />
<Slider.Thumb
getAriaLabel={() => 'edge-aligned-thumb'}
className="size-4 rounded-full bg-white outline outline-1 outline-gray-300 select-none has-[:focus-visible]:outline has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-blue-800"
/>
</Slider.Track>
</Slider.Control>
</Slider.Root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function ExampleSlider() {
<Slider.Control className={styles.Control}>
<Slider.Track className={styles.Track}>
<Slider.Indicator className={styles.Indicator} />
<Slider.Thumb className={styles.Thumb} />
<Slider.Thumb getAriaLabel={() => 'slider-thumb'} className={styles.Thumb} />
</Slider.Track>
</Slider.Control>
</Slider.Root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export default function ExampleSlider() {
<Slider.Control className="flex w-56 touch-none items-center py-3 select-none">
<Slider.Track className="h-1 w-full rounded bg-gray-200 shadow-[inset_0_0_0_1px] shadow-gray-200 select-none">
<Slider.Indicator className="rounded bg-gray-700 select-none" />
<Slider.Thumb className="size-4 rounded-full bg-white outline outline-1 outline-gray-300 select-none has-[:focus-visible]:outline has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-blue-800" />
<Slider.Thumb
getAriaLabel={() => 'slider-thumb'}
className="size-4 rounded-full bg-white outline outline-1 outline-gray-300 select-none has-[:focus-visible]:outline has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-blue-800"
/>
</Slider.Track>
</Slider.Control>
</Slider.Root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ export default function RangeSlider() {
<Slider.Control className={styles.Control}>
<Slider.Track className={styles.Track}>
<Slider.Indicator className={styles.Indicator} />
<Slider.Thumb index={0} className={styles.Thumb} />
<Slider.Thumb index={1} className={styles.Thumb} />
<Slider.Thumb
getAriaLabel={(index) => `range-slider-thumb-${index}`}
index={0}
className={styles.Thumb}
/>
<Slider.Thumb
getAriaLabel={(index) => `range-slider-thumb-${index}`}
index={1}
className={styles.Thumb}
/>
</Slider.Track>
</Slider.Control>
</Slider.Root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ export default function RangeSlider() {
<Slider.Indicator className="rounded bg-gray-700 select-none" />
<Slider.Thumb
index={0}
aria-label="range-slider"
className="size-4 rounded-full bg-white outline outline-1 outline-gray-300 select-none has-[:focus-visible]:outline has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-blue-800"
/>
<Slider.Thumb
index={1}
aria-label="range-slider"
className="size-4 rounded-full bg-white outline outline-1 outline-gray-300 select-none has-[:focus-visible]:outline has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-blue-800"
/>
</Slider.Track>
Expand Down
Loading