Skip to content

Calendar

Download .md

A calendar shows a month on the page to pick a day from, such as a release date when the date is the main task of the screen. In a form, use the Date Picker, which opens this calendar in a popover.

  • Use it inline when picking the date is the task, such as scheduling a release.
  • In forms, use the Date Picker instead, so the calendar only takes space when it is open.
  • For dates far in the past, such as a birth date, use the month and year pickers (captionLayout="dropdown" in React, layout="month-and-year" in Vue).
React
November 2026
Vue
November 2026
Kalender, November 2026
1234
  1. 1Month heading
  2. 2Weekdays, starting Monday
  3. 3Selected day
  4. 4Today

A heading with the month and year, previous and next buttons, a row of short weekday names and the days.

Day Style
Any day 36px (size-9), rounded-md
Today A ring
Selected bg-primary, text-primary-foreground
Outside the month muted-foreground

It speaks English by default (en-GB): “November 2026”, “Mo Tu We Th Fr Sa Su”, and weeks start on Monday. For Indonesian, pass id from react-day-picker/locale in React or locale="id-ID" in Vue, as the example does; Flutter follows the app’s locale.

React Vue Flutter Type Default Use
mode="single" single by default ShadCalendar single Pick one day, a range or several days.
selected, onSelect v-model selected, onChanged Date / DateValue / DateTime none The chosen day.
locale locale the app’s locale locale English (en-GB) Month and day names, and the first day of the week.
defaultMonth default-placeholder initialMonth date today The month shown first.
captionLayout layout captionLayout text label Month and year pickers instead of the heading.
import { useState } from "react"
import { id } from "react-day-picker/locale"
import { Calendar } from "@/components/ui/calendar"
export default function CalendarDemo() {
const [date, setDate] = useState<Date | undefined>(new Date(2026, 10, 14))
return <Calendar locale={id} mode="single" selected={date} onSelect={setDate} defaultMonth={date} className="rounded-lg border border-border" />
}
Terminal window
npx shadcn@latest add https://design.sosialoka.tech/r/react/calendar.json
  • Arrow keys move between days, Page Up and Page Down between months, and Enter or Space picks the day.
  • Each day button says its full date, such as “Sabtu, 14 November 2026”, and whether it is today or chosen.
  • The previous and next buttons are named “Ke bulan sebelumnya” and “Ke bulan berikutnya”.