apps/v4/content/docs/components/base/slider.mdx
npx shadcn@latest add slider
<Step>Install the following dependencies:</Step>
npm install @base-ui/react
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="slider" title="components/ui/slider.tsx" styleName="base-nova" />
<Step>Update the import paths to match your project setup.</Step>
</Steps> </TabsContent> </CodeTabs>import { Slider } from "@/components/ui/slider"
<Slider defaultValue={[33]} max={100} step={1} />
Use an array with two values for a range slider.
<ComponentPreview styleName="base-nova" name="slider-range" />Use an array with multiple values for multiple thumbs.
<ComponentPreview styleName="base-nova" name="slider-multiple" />Use orientation="vertical" for a vertical slider.
Use the disabled prop to disable the slider.
To enable RTL support in shadcn/ui, see the RTL configuration guide.
<ComponentPreview styleName="base-nova" name="slider-rtl" direction="rtl" />See the Base UI Slider documentation.