---
title: "Slider"
description: "A slider for picking a value or a range by dragging or with the keyboard, with steps and both orientations. Built on Base UI."
plan: Free
docs: https://ui.edbn.me/docs/components/slider
---

# Slider

A slider for picking a value or a range by dragging or with the keyboard, with steps and both orientations. Built on Base UI.

## Installation

```bash
npx shadcn@4.19.0 add https://ui.edbn.me/r/slider.json
```

## Dependencies
- npm: @base-ui/react@^1.8.0
- edbn: edbn-base

## Usage

```tsx examples/slider-basic.tsx
"use client";
import { Slider } from "@/components/ui/slider";

export default function SliderBasicPreview() {
  return (
    <Slider
      className="w-64"
      defaultValue={[40]}
      max={100}
      step={1}
      aria-label="Volume"
    />
  );
}
```

## Files
- components/ui/slider.tsx (62 lines)

## For agents
- Base theme, once per project: npx shadcn@4.19.0 add https://ui.edbn.me/r/edbn-base.json
- MCP server with search, items, examples and source: https://ui.edbn.me/mcp
- Every page and item: https://ui.edbn.me/llms.txt
