cnippet/ui
  1. ui
  2. pickers
  3. calendar

pickers

Calendar

A date field component that allows users to enter and edit date. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

Anatomy

Good to know

  • Calendar is a styled wrapper around react-day-picker v10, not Base UI. Every DayPicker prop works.
  • mode is "single" (default), "multiple" or "range". The type of selected and onSelect follows it: a Date, a Date[] or a DateRange (import DateRange from react-day-picker).
  • disabled takes matchers, e.g. disabled={{ before: new Date() }} to block past dates.
  • To focus the calendar when it opens in a popover, use autoFocus. The old initialFocus prop no longer exists.
  • Days from the previous and next months are shown by default. Hide them with showOutsideDays={false}.
  • To change the styling of individual parts, pass classNames. It's merged with the built-in classes.

API Reference

Calendar

A styled wrapper around react-day-picker's DayPicker component. All DayPicker props are forwarded.

Examples

Large Cells

A single-date picker with enlarged day cells via --cell-size for a more spacious, touch-friendly layout.

Date Range

A range picker using mode="range" that lets users select a start and end date with the days between highlighted.

Year and month selection via native dropdowns.

Custom Select Dropdown

Replaces the native dropdown with a styled Select component.

Custom Combobox Dropdown

Replaces the native dropdown with a searchable Combobox component.

Multiple Selection

Pick any number of individual dates — selected dates are listed below.

Appointment Booking

Weekends and fully-booked dates are disabled; only future weekdays are selectable.

Two-Month Range Picker

Side-by-side months for easier date-range selection, with a nights counter.

Event Indicators

Custom DayButton renders colored dots for meetings, deadlines, and holidays.

With Presets

Quick-select buttons for common offsets (Today, Tomorrow, Next Monday, etc.) above a full calendar.

Date of Birth

Dropdown navigation spanning 1900 to today with future dates disabled and live age calculation.

Week Picker

Clicking any day snaps the selection to its full ISO Monday–Sunday week, with week numbers shown.

Holiday Calendar

Highlights public holidays in rose using modifiers and modifiersClassNames. Weekends are disabled and clicking a holiday date shows its name below the calendar.

Hotel Check-in Picker

A single-date picker where check-in is fixed to today (highlighted in primary) and the user selects a check-out date. A summary below shows both dates and the calculated night count.

Habit Tracker

A custom DayButton overlays a check icon on completed days with emerald styling, and a footer row shows the monthly streak count.

Sprint Planner

A two-month range picker for sprint planning that displays start date, end date, and total duration alongside an auto-calculated sprint number badge.

Time Off Request

A range picker paired with leave type pill selectors (Vacation, Sick Leave, Personal, WFH) and a submit button that clears the form on success.

Mini Year View

All twelve months of the current year rendered as compact calendar grids side by side, allowing a full year at a glance with single-date selection.

Time Slot Booking

Selecting a date reveals a grid of available and booked time slots; choosing a free slot enables a confirm button that resets the form on success.