@biem/ui

Calendar

A grid of days that lets users select a day, several days or a range of days.

A calendar lays out the days of a month in a grid, and users move from month to month with the two buttons above it. Its mode sets what a press on a day selects: one day, several days or a range of days.

November 2026

Usage

calendar-default.tsx
"use client";

import { Calendar } from "@biem/ui/components/ui/calendar";

export function CalendarDefault() {
	return <Calendar mode="single" defaultMonth={new Date(2026, 10)} className="rounded-lg border"/>;
}

Examples

Multiple Selection

Deliveries, store visits and stock counts rarely fall on consecutive days. With mode set to "multiple", each press on a day adds it to the selection and a second press removes it again, so users collect exactly the days they need.

November 2026

Range Selection

A promotion or a reporting period runs from one day to another. Once mode is set to "range", users mark the period by its first and its last day, in either order, and every day between them joins the selection.

November 2026

Month and Year Dropdowns

Dates far from the current month, such as the start of a lease or a stock count in a past year, take many steps with the navigation buttons. Setting captionLayout to "dropdown" lets users pick the month and the year directly, while startMonth and endMonth set the span of months on offer, which otherwise ends with the current year.

November 2026

Outline Navigation

Planning a season means stepping through many months, and users should find the buttons that change the month at a glance. Through buttonVariant set to "outline", both buttons carry the emphasis of an outline button, so users recognize them as actions in their own right.

November 2026

Multiple Months

A period that crosses the end of a month is hard to judge one month at a time. With numberOfMonths set to 2, users see both months at once, and each step of the navigation still moves the calendar by a single month.

November 2026
December 2026

Week Numbers

Many retailers plan promotions and assortment changes by calendar week. Once showWeekNumber is on, the calendar numbers every week, following the locale or, with ISOWeek, the ISO standard.

November 2026
45
46
47
48
49

Without Outside Days

By default, the days of the neighboring months complete the first and the last week, and users can select them without changing the month. Where only the days of one month count, as in a monthly plan, showOutsideDays set to false removes them, so no day of another month enters the selection by mistake.

November 2026

Today

The business date of a store can differ from the date on the device, for example after a late closing or in another time zone. Through the today prop, the application sets the day that the calendar marks as today, so users orient themselves by the date that counts for their work.

November 2026

Controlled Selection

Often the chosen date drives other parts of a screen, such as the delivery slots offered for that day. Together, selected and onSelect hand the selection to the application, which can preset a date, clear it or react to every change.

November 2026

Controlled Month

A list of open orders can lead users straight to the month of the order they choose. For this purpose, month and onMonthChange let the application hold the month that the calendar shows, while the navigation buttons keep working.

November 2026

Hidden Navigation

Where the surrounding interface already switches the month, for example with a period selector in the page header, a second navigation would compete with it. In that case, hideNavigation removes the two buttons of the calendar, while users can still change the month with the keyboard.

November 2026

Hidden Weekdays

Some choices depend on the date alone, such as the expiry date of a product. Here, hideWeekdays leaves out the row of weekday names, so the calendar needs less room.

November 2026

Hidden Days

Days before a store opens or after a lease ends play no part in its planning. Matched by hidden, such days drop out of view, so users can't select them and keyboard focus passes over them.

November 2026

Disabled Navigation

Certain schedules cover one month only, such as the dates of a monthly stock count. With disableNavigation, users can't leave that month, neither with the buttons nor with the keyboard.

November 2026

Disabled Days

A store that stays closed on certain days accepts no deliveries on them. Passed to disabled, a matcher such as a day of the week keeps those days in view but out of reach: users can't select them, and the arrow keys skip them.

November 2026

Disabled

While an order awaits approval, its delivery date must not change. Set to true, disabled locks every day, and users can still move between months to read the dates.

November 2026

API Reference

Calendar

Propmode
Type"single" | "multiple" | "range"
Default–
DescriptionSets what users select: one day, several days or a range of days. Without it, the calendar renders the days as text and users can't select any.
Proprequired
Typeboolean
Defaultfalse
DescriptionPrevents users from clearing the selection. With it, TypeScript requires selected, and onSelect never receives undefined.
Propselected
TypeDate | Date[] | DateRange
Default–
DescriptionSets the selection: a date in single mode, an array of dates in multiple mode, and an object with from and to in range mode. Pass it together with onSelect to control the selection. Without onSelect, it only sets the selection at first render.
ProponSelect
Type(selected: Date | Date[] | DateRange | undefined, triggerDate: Date, modifiers: Modifiers, e: MouseEvent | KeyboardEvent) => void
Default–
DescriptionRuns when users press a day to select or clear it. It receives the selection that follows, the day that users pressed and the modifiers of that day. With it, the calendar shows only the selection passed in selected.
Propmin
Typenumber
Default–
DescriptionSets the smallest selection in multiple and range mode. In multiple mode, users can't remove a day while only min days are selected. In range mode, a range with fewer than min days between its start and its end starts over at the pressed day.
Propmax
Typenumber
Default–
DescriptionSets the largest selection in multiple and range mode. In multiple mode, a press on another day replaces a selection of max days with that day. In range mode, a range with more than max days between its start and its end starts over at the pressed day.
PropexcludeDisabled
Typeboolean
Defaultfalse
DescriptionStarts the range over at the pressed day when the range would include a disabled day. It applies in range mode.
PropresetOnSelect
Typeboolean
Defaultfalse
DescriptionStarts a new range at the pressed day when the range is complete, instead of moving its start or its end. It applies in range mode.
Propdisabled
TypeMatcher | Matcher[]
Default–
DescriptionDisables the matching days, so users can't select them. A matcher is true, a date, an array of dates, a range, a function, or an object with before, after or dayOfWeek. true disables every day.
Prophidden
TypeMatcher | Matcher[]
Default–
DescriptionHides the matching days. Their cells stay in the grid and are empty.
Propmodifiers
TypeRecord<string, Matcher | Matcher[] | undefined>
Default–
DescriptionAssigns custom modifiers, such as holiday, to the days that match them. modifiersClassNames and modifiersStyles style these days, and the event handlers receive the modifiers of a day.
Proptoday
TypeDate
Default–
DescriptionSets the day that the calendar marks as today. Without it, the calendar marks the current date.
PropautoFocus
Typeboolean
Defaultfalse
DescriptionMoves focus to a day when the calendar appears: to the selected day, otherwise to today, otherwise to the first day of the month that users can focus.
PropdefaultMonth
TypeDate
Default–
DescriptionSets the month that the calendar shows at first render. The calendar then tracks the month itself. Without it, the calendar opens on the current month.
Propmonth
TypeDate
Default–
DescriptionSets the month that the calendar shows and makes the month controlled. Update it in onMonthChange.
ProponMonthChange
Type(month: Date) => void
Default–
DescriptionRuns when users move to another month. It receives the first day of the first month that the calendar then shows.
PropstartMonth
TypeDate
Default–
DescriptionSets the earliest month that users can move to and hides the days before it. Without it, a calendar with a year dropdown starts 100 years before the current year.
PropendMonth
TypeDate
Default–
DescriptionSets the latest month that users can move to and hides the days after it. Without it, a calendar with a year dropdown ends with the current year.
PropnumberOfMonths
Typenumber
Default1
DescriptionSets how many months the calendar shows at the same time. The months stack on narrow screens and sit side by side from the md breakpoint.
ProppagedNavigation
Typeboolean
Defaultfalse
DescriptionMoves the calendar by numberOfMonths months per step instead of by one month.
PropreverseMonths
Typeboolean
Defaultfalse
DescriptionShows several months in reverse order, with the latest month first.
PropdisableNavigation
Typeboolean
Defaultfalse
DescriptionPrevents users from moving to another month. The navigation buttons and the dropdowns stay visible and are disabled.
ProphideNavigation
Typeboolean
Defaultfalse
DescriptionHides the two navigation buttons. Users can still change the month with the keyboard and with the dropdowns.
ProponNextClick
Type(month: Date) => void
Default–
DescriptionRuns when users press the button for the next month. It receives the month that the calendar moves to.
ProponPrevClick
Type(month: Date) => void
Default–
DescriptionRuns when users press the button for the previous month. It receives the month that the calendar moves to.
PropcaptionLayout
Type"label" | "dropdown" | "dropdown-months" | "dropdown-years"
Default"label"
DescriptionSets how the caption shows month and year. "label" shows both as text, "dropdown" shows a dropdown for each, and "dropdown-months" and "dropdown-years" show a dropdown for one of them and the other as text.
PropreverseYears
Typeboolean
Defaultfalse
DescriptionLists the years in the year dropdown from the latest to the earliest.
PropnavLayout
Type"around" | "after"
Default–
DescriptionSets where the navigation buttons sit in the markup. "around" renders the previous button before the caption and the next button after it, and "after" renders both after the caption. Without it, both come before the first month.
PropbuttonVariant
Type"default" | "outline" | "secondary" | "ghost" | "destructive" | "link"
Default"ghost"
DescriptionSets the Button variant of the two navigation buttons.
PropshowOutsideDays
Typeboolean
Defaulttrue
DescriptionShows the days of the previous and the next month in the first and the last week of a month.
PropshowWeekNumber
Typeboolean
Defaultfalse
DescriptionAdds a column with the number of each week.
PropfixedWeeks
Typeboolean
Defaultfalse
DescriptionShows six weeks for every month, so the calendar keeps its height from month to month. Days of the next month fill the added weeks.
ProphideWeekdays
Typeboolean
Defaultfalse
DescriptionHides the row with the names of the weekdays.
Propanimate
Typeboolean
Defaultfalse
DescriptionAnimates the change between months with the CSS animations that react-day-picker defines for its animation class names. The calendar doesn't load that stylesheet.
Propfooter
TypeReactNode
Default–
DescriptionAdds content below the months as a live region, so screen readers announce it when it changes. The calendar sets no classes for it.
Proplocale
TypePartial<Locale>
DefaultenUS
DescriptionSets the language of the month and weekday names and the first day of the week. Pass a locale from react-day-picker/locale.
Propdir
Typestring
Default–
DescriptionSets the text direction of the calendar. With "rtl", the left and the right arrow key swap their direction.
PropweekStartsOn
Type0 | 1 | 2 | 3 | 4 | 5 | 6
Default–
DescriptionSets the first day of the week, where 0 is Sunday. Without it, the locale decides.
PropISOWeek
Typeboolean
Defaultfalse
DescriptionUses ISO week dates instead of the locale. weekStartsOn and firstWeekContainsDate then have no effect.
PropbroadcastCalendar
Typeboolean
Defaultfalse
DescriptionLays out the weeks of a month by the broadcast calendar. Weeks then start on Monday, whatever weekStartsOn says.
PropfirstWeekContainsDate
Type1 | 4
Default–
DescriptionSets the day of January that always falls in the first week of the year, which decides the week numbers. Without it, the locale decides.
Propnumerals
TypeNumerals
Default"latn"
DescriptionSets the numbering system of the digits, such as "arab" or "deva".
ProptimeZone
Typestring
Default–
DescriptionSets the time zone of the calendar as an IANA name or a UTC offset. The prop is experimental.
PropnoonSafe
Typeboolean
Defaultfalse
DescriptionSets the time of all dates to noon in the time zone, so that historical offsets can't move a date across midnight. It applies when timeZone is set, and it is experimental.
PropuseAdditionalWeekYearTokens
Typeboolean
Defaultfalse
DescriptionAllows the week year tokens YY and YYYY in the formats that the date library receives.
PropuseAdditionalDayOfYearTokens
Typeboolean
Defaultfalse
DescriptionAllows the day of year tokens D and DD in the formats that the date library receives.
PropdateLib
TypePartial<DateLib>
Default–
DescriptionReplaces functions of the date library that the calendar computes and formats dates with. The prop is experimental.
PropclassNames
TypePartial<ClassNames>
Default–
DescriptionSets the class names of the elements of the calendar by key, such as month_caption or weekday. A key replaces the classes that the calendar sets for that element.
PropmodifiersClassNames
TypeRecord<string, string>
Default–
DescriptionSets a class name for the days that match a modifier, by the name of the modifier. For a modifier such as today or selected, it replaces the class that the calendar sets.
Propstyles
TypePartial<Styles>
Default–
DescriptionSets inline styles for the elements of the calendar, by the same keys as classNames.
PropmodifiersStyles
TypeRecord<string, CSSProperties>
Default–
DescriptionSets inline styles for the days that match a modifier, by the name of the modifier.
Propcomponents
TypePartial<CustomComponents>
Default–
DescriptionReplaces the components that render the elements of the calendar by key, such as DayButton or Chevron. The calendar sets Root, Chevron, DayButton and WeekNumber itself, and a key replaces its component.
Propformatters
TypePartial<Formatters>
Default–
DescriptionReplaces the functions that format the texts of the calendar, such as formatCaption or formatWeekdayName. The calendar sets formatMonthDropdown to the short name of the month in the language of locale, or of the runtime when locale isn't set, and the key replaces it.
Proplabels
TypePartial<Labels>
Default–
DescriptionReplaces the functions that create the aria-label of the elements, such as labelNext or labelDayButton.
ProponDayClick
Type(date: Date, modifiers: Modifiers, e: MouseEvent) => void
Default–
DescriptionRuns when users press a day that isn't disabled. With it, the calendar renders the days as buttons even without a mode.
ProponDayFocus
Type(date: Date, modifiers: Modifiers, e: FocusEvent) => void
Default–
DescriptionRuns when a day receives focus.
ProponDayBlur
Type(date: Date, modifiers: Modifiers, e: FocusEvent) => void
Default–
DescriptionRuns when a day loses focus.
ProponDayKeyDown
Type(date: Date, modifiers: Modifiers, e: KeyboardEvent) => void
Default–
DescriptionRuns when users press a key while a day has focus.
ProponDayMouseEnter
Type(date: Date, modifiers: Modifiers, e: MouseEvent) => void
Default–
DescriptionRuns when the pointer enters a day.
ProponDayMouseLeave
Type(date: Date, modifiers: Modifiers, e: MouseEvent) => void
Default–
DescriptionRuns when the pointer leaves a day.

CalendarDayButton

Propday
TypeCalendarDay
Default–
DescriptionSets the day that the button stands for, with its date in day.date. The calendar passes day and modifiers to the component in components.DayButton. The component requires this prop.
Propmodifiers
TypeModifiers
Default–
DescriptionSets the modifiers of the day as a record of booleans, such as selected, today or range_start. The button takes its selection styles from them and takes focus when focused is true. The component requires this prop.
Proplocale
TypePartial<Locale>
Default–
DescriptionSets the locale whose code formats the date in the data-day attribute of the button.