Skip to content

Data Input

DateInput

Segmented date field with calendar popover.

import { DateInput } from '@var-ui/react';
Date

DateInput

Single-date field with segmented text entry (month/day/year) plus a trigger that opens a popover month calendar. Values use @internationalized/date (CalendarDate).

Examples

Default

Pass a label and seed with defaultValue (or control via value / onValueChange).

Date
Demo.tsxTSX
import { CalendarDate } from '@internationalized/date';
import { DateInput } from '@var-ui/react';

<DateInput label="Date" defaultValue={new CalendarDate(2026, 8, 12)} />

Description and error

Use description for helper copy and errorMessage for validation — setting errorMessage marks the field invalid.

Deadline

Must be a weekday

Pick a weekday
Demo.tsxTSX
import { CalendarDate } from '@internationalized/date';
import { DateInput } from '@var-ui/react';

<DateInput
  label="Deadline"
  description="Must be a weekday"
  errorMessage="Pick a weekday"
  defaultValue={new CalendarDate(2026, 8, 15)}
/>

Sizes

size (sm, md, lg) sets the segment group height, inset and type, matching TextField. It falls back to the surrounding control size (InputGroup, Toolbar, Select.Root), then md.

Props

Accessibility

Built on React Aria DatePicker. Each date segment is a focusable spinbutton; the calendar trigger is a labeled button that opens a dialog with a keyboard-navigable grid. Keep label visible, and use description / errorMessage so assistive tech gets the same help and validation copy as sighted users.