Skip to content
HomeCobalt

Calendar

Shows a month of days, or two side by side, to pick one day, a start and an end, or several days, with today marked and the days you cannot pick held back.

Examples

One month with today marked and a day picked, the week starting where your locale starts it.
SunMonTueWedThuFriSat
Locale deIn German, month and weekday names come from Intl and the week starts on Monday.
MoDiMiDoFrSaSo
Mode multipleDays picked side by side join into one shape, and once five are picked the other days are held back.
SunMonTueWedThuFriSat

Nov 10 to 12 and Nov 18, 4 of 5 days

Mode rangeThe first press sets check-in and the second check-out, and until then the band and the count follow the pointer.
SunMonTueWedThuFriSat

Nov 12 to 16, 4 nights

Mode singleOne day, with the pick in the accent and the line under today.
SunMonTueWedThuFriSat

Viewing on November 20, 2026.

In a cardPick the nights in a listing's card, and the price follows.
Harbour loft
$145.00 a nightChoose check-in, then check-out
SunMonTueWedThuFriSat

States

SunMonTueWedThuFriSat

Struck-through nights are booked. With check-in on Nov 12, check-out can be Nov 13 to Nov 19, the morning the next booking begins.

DisabledDays before today are dimmed, booked nights are struck through, and a stay can end the morning a booked night begins but never runs over it.

Usage

Use it when

  • Picking a day where seeing the week and month helps, such as a viewing, a booking or a report date.
  • Picking a stay or a reporting period, a start and an end, with the days between in view.
  • Picking several separate days, such as study days or the days a desk is needed.
  • Showing which days cannot be picked, such as nights already booked.

Use something else when

  • A form field for a day. Use DatePicker instead, which opens this in a popover, or a sheet on a phone.
  • A birth date or a day years away. Use DatePicker instead, with typed, so the day is typed rather than paged to.
  • A choice among a few named periods, such as "Last 30 days". Use SegmentedControl instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/calendar.json
import { Calendar, daysBetween, formatDate, formatDateRange, formatDays, parseDate, weekStartFor, type DateRange } from "@/components/cobalt/ui/calendar"