A labeled month calendar that stays on the page; picks one ISO date, or a start and end date with range.
A Markdown brief for Claude, Cursor or v0: install, setup, props and a complete example.
For a screen where picking the day is the main job: booking a time, or choosing the day an agenda shows. The month stays on the page.
A date inside a form? Date Picker keeps it to one field.
An ARIA date grid named by its month, with one Tab stop: arrow keys move by day and week, Page Up/Down by month, Home/End to the week’s ends. Chosen days are announced as selected and today as the current date; unavailable days are announced and can’t be chosen.
import { Calendar } from '@idyeah/diya'Stable since 1.0.0
labelRequiredstringVisible label above the calendar; also names it for assistive tech. Hide it with hideLabel.
disabledbooleanDims the calendar and stops every day and month button.
Default false
hideLabelbooleanHides the label visually but keeps it as the calendar's accessible name.
Default false
isDateUnavailable(date: string) => booleanCalled with each ISO YYYY-MM-DD day on show; return true to mark the day unavailable (announced, and it can't be chosen), as with min and max.
maxstringLatest date that can be chosen, as ISO YYYY-MM-DD; later days show as unavailable.
minstringEarliest date that can be chosen, as ISO YYYY-MM-DD; earlier days show as unavailable.
monthstringThe month on show as ISO YYYY-MM, when controlled; pair it with onMonthChange. Left out, the calendar starts on the chosen date's month, or today's.
onMonthChange(month: string) => voidCalled with the ISO YYYY-MM month to show: from the month buttons, from the keyboard moving into another month, or when value changes to a date in another month.
rangebooleanSingle-date mode (the default): leave unset or false. Range mode: the first click sets the start, the second the end (swapped if earlier); the next click starts a new range.
size"small" | "medium" | "large"Day height and type size, matching fields of the same size; defaults to 'medium'.
Default 'medium'
range={false} (the default)defaultValuestringThe initially chosen ISO date when uncontrolled.
onValueChange(value: string) => voidCalled with the chosen ISO YYYY-MM-DD date.
valuestringThe chosen date as ISO YYYY-MM-DD, or '' for none, when controlled; pair it with onValueChange.
range={true}defaultValueDateRangeThe initially chosen range when uncontrolled.
onValueChange(value: DateRange) => voidCalled with the new range after each click; end is '' until the second date is chosen.
valueDateRangeThe chosen range as ISO YYYY-MM-DD dates, a bound '' while unset, when controlled; pair it with onValueChange.
Also takes every native <div> attribute, such as id, aria-* or data-*.