# Slider (Andromeda Legacy)

Slider is a component of the free, MIT-licensed Andromeda Legacy design system from AI Canvas (https://aicanvas.me). Index of every system, component and install setup: https://aicanvas.me/llms.txt

Custom horizontal range. Pointer drag + full keyboard support. ARIA-compliant.

- Design system: [Andromeda Legacy](https://aicanvas.me/design-systems/andromeda.md)
- License: MIT
- Install slug: `andromeda-slider`
- Page: https://aicanvas.me/design-systems/andromeda/slider

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-slider
```

Needs a free AI Canvas account; signed out, the command writes a placeholder (an `AccountRequired` notice) instead.

Every Andromeda Legacy component at once: `npx shadcn@latest add @aicanvas/andromeda`.

Token setup: the Install section of https://aicanvas.me/llms.txt.

## Use it

It installs to `components/aicanvas/andromeda/components/Slider.tsx` (under `src/` if your project has one). With the usual `@/` alias:

```tsx
import { Slider } from '@/components/aicanvas/andromeda/components/Slider'
```

## Example

```tsx
import { Slider } from '@/components/aicanvas/andromeda/components/Slider'

<Slider label="Alert threshold" defaultValue={75} min={0} max={100} unit="%" />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value?` | `number` |  | Controlled value. |
| `defaultValue?` | `number` |  | Uncontrolled initial value. |
| `min?` | `number` | `0` | Minimum value of the range. |
| `max?` | `number` | `100` | Maximum value of the range. |
| `step?` | `number` | `1` | Increment the value snaps to. |
| `onValueChange?` | `(next: number) => void` |  | Handler called with the new value on drag or keyboard change. |
| `label?` | `string` |  | Optional uppercase mono label. |
| `showValue?` | `boolean` | `true` | Render the numeric readout next to the label. |
| `unit?` | `string` |  | Optional unit suffix (e.g. "%", "KM"). |
| `disabled?` | `boolean` | `false` | Disables interaction and dims the slider. |
| `className?` | `string` |  | Additional classes for the root wrapper. |
| `style?` | `React.CSSProperties` |  | Inline styles merged onto the root wrapper. |
| `id?` | `string` |  | Id for the slider track; auto-generated when omitted. |

## More Andromeda Legacy components

- [Spinner](https://aicanvas.me/design-systems/andromeda/spinner.md)
- [Stat Tile](https://aicanvas.me/design-systems/andromeda/stat-tile.md)
- [Tag](https://aicanvas.me/design-systems/andromeda/tag.md)
- [Textarea](https://aicanvas.me/design-systems/andromeda/textarea.md)
- [Toggle](https://aicanvas.me/design-systems/andromeda/toggle.md)
