Skip to content

Commit

Permalink
Update story to include fixed example
Browse files Browse the repository at this point in the history
  • Loading branch information
Rheddes committed Sep 12, 2024
1 parent f208c83 commit 2c9e605
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .yarn/versions/fecf9f47.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
releases:
"@radix-ui/react-slider": patch

declined:
- primitives
20 changes: 20 additions & 0 deletions packages/react/slider/src/Slider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,26 @@ export const Strict = () => (
</React.StrictMode>
);

export const InScrollableContext = () => {
const [value, setValue] = React.useState(0);

return (
<div style={{ width: '40vw', overflowX: 'scroll', border: '1px' }}>
<Slider.Root
className={rootClass()}
style={{ width: '100vw' }}
value={[value]}
onValueChange={([newValue]: [number]) => setValue(newValue)}
>
<Slider.Track className={trackClass()}>
<Slider.Range className={rangeClass()} />
</Slider.Track>
<Slider.Thumb className={thumbClass()} />
</Slider.Root>
</div>
);
};

export const Chromatic = () => (
<>
<h1>Uncontrolled</h1>
Expand Down

0 comments on commit 2c9e605

Please sign in to comment.