# Date Range Picker (Andromeda Legacy)

Date Range Picker 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

Trigger chip + drop-down calendar panel. Anchor-then-confirm range selection with hover preview, Monday-first grid, ESC and click-outside to close.

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

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-date-range-picker
```

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/DateRangePicker.tsx` (under `src/` if your project has one). With the usual `@/` alias:

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

## Example

```tsx
import { useState } from 'react'
import { DateRangePicker } from '@/components/aicanvas/andromeda/components/DateRangePicker'

const [range, setRange] = useState({ start: new Date(2026, 10, 1), end: new Date(2026, 10, 30) });

<DateRangePicker value={range} onChange={setRange} presetLabel="This month" />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value?` | `{ start: Date, end: Date }` |  | Selected date range; controlled. |
| `onChange?` | `(range: { start: Date, end: Date }) => void` |  | Called with the new range once both endpoints are chosen. |
| `presetLabel?` | `string` |  | Label for the active preset shown in the trigger (for example "Last month"). |
| `defaultOpen?` | `boolean` | `false` | Whether the calendar panel starts open (uncontrolled). |
| `staticOpen?` | `boolean` | `false` | Pins the panel open and disables the dismissers; for showcases and docs. |
| `className?` | `string` |  | Additional CSS classes applied to the root element. |
| `style?` | `React.CSSProperties` |  | Inline styles applied to the root element. |

## More Andromeda Legacy components

- [Drawer](https://aicanvas.me/design-systems/andromeda/drawer.md)
- [Empty State](https://aicanvas.me/design-systems/andromeda/empty-state.md)
- [Gauge](https://aicanvas.me/design-systems/andromeda/gauge.md)
- [Heat Grid](https://aicanvas.me/design-systems/andromeda/heat-grid.md)
- [Icon Button](https://aicanvas.me/design-systems/andromeda/icon-button.md)
