Calendar

A keyboard-navigable Gregorian month grid with date-only values.

Interactive preview

Live specimenTry the component

October 2026

SunMonTueWedThuFriSat

Arrow keys move days. Page Up/Down changes month.

Review date: 2026-10-23. Local date-only value.

Installation

Add editable source to an initialized React project. Set up antiflex/ui first if you are new here.

Terminal
npx antiflex-ui@0.1.0-alpha.2 add calendar

This site previews the latest workspace styles and motion. The published alpha keeps its released styles until the next npm release.

Usage

React
<Calendar value={date} onValueChange={setDate}
  locale="id-ID" weekStartsOn={1}
  min="2026-10-01" max="2027-12-31" today="2026-10-23" />

API reference

All components forward native attributes, className, and refs to their underlying elements.

PropTypeDefault
value / defaultValue / onValueChangeYYYY-MM-DD / (string) => void''
month / defaultMonth / onMonthChangeYYYY-MM / (string) => voidselected date or today
min / maxYYYY-MM-DDoptional
disabledboolean | (date: string) => booleanfalse
locale / weekStartsOnIntl locale / 0–6 (Sunday–Saturday)en-US / 0
todayYYYY-MM-DDcurrent UTC date

Accessibility

Single-date Gregorian grid with YYYY-MM-DD values and UTC arithmetic, preventing host timezone/DST offsets. Month is YYYY-MM; labels use Intl with locale and explicit weekStartsOn. One date button is in Tab order. Arrows move by day/week (horizontal keys respect RTL), Home/End moves within the week, Page Up/Down changes month, Shift adds year navigation, Enter/Space selects. Unavailable dates remain keyboard-discoverable with aria-disabled and cannot be selected. min/max clamp navigation; header controls respect month boundaries. Today has aria-current=date and the month heading announces changes. Disabled=true removes day buttons from Tab order. Controlled date/month and reset state are consumer-owned. Ref/native attributes target the div; standalone Calendar does not submit form data. UTC today is the default; pass a local date-only today when the application uses another time zone. Ranges, multiple months and alternate calendar systems are not included.