Xzero UI
Pro library

Calendar

Browse dates in a clear, compact month view.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/calendar
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/calendar

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { Calendar } from "@/components/xzero/calendar/calendar";

export function DeliveryDate() {
  const [date, setDate] = useState<Date>();
  return (
    <Calendar
      value={date}
      onChange={setDate}
      minDate={new Date()}
      disabledDates={(day) => day.getDay() === 0}
      showToday
    />
  );
}

API reference

Calendar

A month grid for picking one date, with sliding month changes and a gliding selection.

PropTypeDefaultDescription
valueDate–Selected date.
onChange(date: Date) => void–Called when a day is picked.
monthDate–Controlled visible month.
onMonthChange(month: Date) => void–Called with the first of the new month when navigating.
minDateDate–Earliest selectable day.
maxDateDate–Latest selectable day.
disabledDates(date: Date) => boolean–Return true to block a day, such as weekends.
localestring"en-US"Month, weekday, and day names.
classNamestring–Added to the root section.
showTodaybooleanfalseAdds a Today button that returns to the current month and selects today when allowed.

useToday

Hook returning the viewer's local date, undefined during SSR and hydration, and updating across midnight.

No props.

Keyboard interactions

KeysAction
Arrow keysMove by one day or one week, skipping blocked days and crossing months.
Home / EndMove to the start or end of the week.
PageUp / PageDownMove by one month; with Shift, by one year.
Enter / SpaceSelects the focused day.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in pickers

Guidance for AI tools

Calendar: Browse dates in a clear, compact month view. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components