Skip to content
Back to skills

Date Input

ASecurity

Text input with calendar popup for date selection. Supports single dates and date ranges with optional preset quick filters. Built on Input, Calendar, and Menu components.

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 27, 2026
data-aireact

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add reaviz/skills --skill date-input --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Date Input?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Date Input
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reaviz-date-input/badge)](https://www.skillsdirectory.com/skills/reaviz-date-input)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# DateInput

Text input with calendar popup for date selection. Supports single dates and date ranges with optional preset quick filters. Built on Input, Calendar, and Menu components.

## Import

```tsx
import { DateInput } from 'reablocks';
```

## DateInput Props

Extends Input props (except `value` and `onChange`), plus:

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `value` | `Date` (single) or `[Date, Date]` (range) | — | Selected date(s) |
| `onChange` | `(value: Date) => void` or `(value: [Date, Date]) => void` | — | Date change handler |
| `isRange` | `boolean` | `false` | Enable range mode |
| `format` | `string` | `'MM/dd/yyyy'` | date-fns format string for display/parsing |
| `placement` | `Placement` | `'bottom-start'` | Calendar popup placement |
| `openOnFocus` | `boolean` | `true` | Open calendar when input is focused |
| `preset` | `PresetOption[]` | `[]` | Preset date options (shows list before calendar) |
| `openCalendarOptionName` | `string` | `'Custom Date'` / `'Custom Dates'` | Label for the "open calendar" option in preset list |
| `icon` | `ReactElement` | `<CalendarIcon />` | Icon for the calendar button |
| `theme` | `DateInputTheme` | — | Per-instance theme override |

## Single Date

```tsx
const [date, setDate] = useState(new Date());
<DateInput value={date} onChange={setDate} />
```

## Date Range

```tsx
const [range, setRange] = useState<[Date, Date]>([startDate, endDate]);
<DateInput value={range} isRange onChange={setRange} />
```

## With Presets

```tsx
const presets: PresetOption[] = [
  { label: 'Today', value: new Date() },
  { label: 'Last 7 days', value: () => [subDays(new Date(), 7), new Date()] }
];

<DateInput value={date} preset={presets} onChange={setDate} />
```

When presets are provided, a list of options is shown first. Selecting "Custom Date" opens the full calendar.

## Custom Format

```tsx
<DateInput value={date} format="yyyy-MM-dd" onChange={setDate} />
```

The input placeholder automatically shows the format in uppercase (e.g. `MM/DD/YYYY`). Users can type dates directly — the input parses them using the format string.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.