Skip to Content
glob.ui home
Components

Calendar

A month grid for picking one day or a range of days. Values are ISO date strings ("YYYY-MM-DD"), so they serialize and compare without time zones.

Client componentUses state or handlers, so it starts with "use client".
import { Calendar, toISODate, parseISODate, addDays, addMonths, isSameDay, compareISODate, todayISODate } from "@glob-ui/calendar"

Preview

November 2026
SunMonTueWedThuFriSat

Selected: 2026-11-09

Examples

Range

mode="range" with { from, to }. The first click sets from, the second sets to (swapped if earlier). Hover previews the range. min, max and disabled days can sit inside a range.

November 2026
SunMonTueWedThuFriSat
December 2026
SunMonTueWedThuFriSat

2026-11-03 to 2026-11-09. The first click sets the start; the second sets the end. Hover previews the range.

Limits and disabled days

min and max disable the days outside them, and navigation stops at their months. isDateDisabled disables more days; they can still receive focus, but cannot be selected.

November 2026
SunMonTueWedThuFriSat

Weekdays from Nov 5 to Dec 20. Days outside are disabled, and the arrows stop at the first and last month.

Locale

locale sets the month and weekday names and the first day of the week (from the locale; override it with weekStartsOn).

noviembre de 2026
lunmarmiéjueviesábdom

The week starts on Monday and the names follow the locale (es-ES). Pass weekStartsOn to override it.

API

Props are generated from the TypeScript types in the package source.

Calendar (single)

Prop

Type

Calendar (range)

Prop

Type

Accessibility

Key or actionBehaviour
TabMoves into the grid on one day (the selected day, else today). Tab again leaves it.
Arrow keysMove one day (Left, Right) or one week (Up, Down). Focus crosses into another month, which becomes the visible one.
Home, EndFirst and last day of the week.
PageUp, PageDownOne month, on the same day (clamped to the month's length). Shift adds a year.
Enter, SpaceSelects the focused day.

ARIA. A role="grid" table per month, named by its heading (a polite live region, so a month change is announced). Each day is a gridcell with a button. Selected days have aria-selected, today has aria-current="date", and disabled days have aria-disabled (focusable, not selectable).

On this page