Date Of Birth Input
Date of birth as three selects in locale order. Pro · Forms and input › Date and time
Installation
npx valyro-cli@latest login
npx valyro-cli@latest add date-of-birth-input
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { DateOfBirthInput } from 'valyro-ui-pro';
Props
| Prop | Type | Default | |
|---|---|---|---|
value | string | The date as YYYY-MM-DD (controlled); an empty string while it is incomplete. | |
defaultValue | string | Initial value when uncontrolled. | |
onValueChange | (value: string) => void | Called with YYYY-MM-DD once day, month and year are all chosen, and with '' when one is cleared. | |
minYear | number | Earliest year offered. Default: 120 years ago. | |
maxYear | number | Latest year offered (e.g. this year minus the minimum age). Default: this year. | |
order | 'dmy' | 'mdy' | 'ymd' | Field order; by default the locale's own (day–month–year in Russian, month–day–year in US English). | |
name | string | Name of a hidden input carrying YYYY-MM-DD, so the date submits with a form. | |
size | 'sm' | 'md' | 'lg' | 'md' | Height of the selects. Default md. |
invalid | boolean | false | Marks the fields as invalid (too young, required and empty). |
disabled | boolean | false | Disables the whole control. |
locale | string | BCP 47 locale for the month names and the default order. | |
labels | Partial<DateOfBirthInputLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Related components
- Date Picker — Date selection
- Date Range Picker — Date range selection
- Date Field — Date typed segment by segment in the locale order
- Time Picker — Time selection
- Time Field — Time typed segment by segment, 24-hour or AM/PM
- Wheel Picker — iOS-style picker wheel: momentum, 3D cylinder, date and time presets
- Text Input — Text fields
- Textarea — Multiline text input
- Search Input — Search field
- Mentions Input — Text with @mentions and #tags, async suggestions
- Tags Input — Tag entry
- Select — Pick one option from a list
Previous: Wheel Picker · Next: Color Picker · All Forms and input