Calendar
Birth Date Fields
A date of birth as three fields instead of a month grid: day, month and year typed from the keyboard, with validation that separates an impossible day, a future date and an age limit.
What you can change
- label — the heading of the field group
- defaultValue — the initial date as a YYYY-MM-DD string, or empty
- minAge — the minimum age below which the form complains
A link for your AI agent: preview, code and instructions.
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this on the home page as the hero:
https://vibeui.ru/c/calendar-024?lang=en&theme=dark
Not sure where to paste it? Step-by-step guide
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
Loading…
For developers
The install command lives in the “Component source” block below — a signed link that stays valid for 24 hours.
Technical notes
The component is self-contained: one file, zero dependencies, its own palette in local variables --vibeui-calendar-024-*. Client-side: the three parts of the date live in separate useStates, and onChange hands out the assembled YYYY-MM-DD string, or an empty string if the date is incomplete. The root is a <fieldset> with a <legend>, every field has its own <label>, and autofill is enabled by the attributes autoComplete="bday-day|bday-month|bday-year". The month is a <select> with names from Intl, so the digit 07 does not argue with the date format of the user's country. The validation is assembled in a single useMemo and returns not a boolean but an idle/ok/bad state with text: the number of days in a month is computed through new Date(year, month, 0).getDate(), and the age by comparing month and day. The state is lifted to the root as data-state, so the field borders and the label colour are painted by a single rule.
Tags
- calendar
- birthday
- form
- validation
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…