ValyroUI Русская версия

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

PropTypeDefault
valuestringThe date as YYYY-MM-DD (controlled); an empty string while it is incomplete.
defaultValuestringInitial value when uncontrolled.
onValueChange(value: string) => voidCalled with YYYY-MM-DD once day, month and year are all chosen, and with '' when one is cleared.
minYearnumberEarliest year offered. Default: 120 years ago.
maxYearnumberLatest 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).
namestringName 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.
invalidbooleanfalseMarks the fields as invalid (too young, required and empty).
disabledbooleanfalseDisables the whole control.
localestringBCP 47 locale for the month names and the default order.
labelsPartial<DateOfBirthInputLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Wheel Picker · Next: Color Picker · All Forms and input