GooseUI

Components

Calendar

New

A month calendar on a table with role grid. Select one date or a range, switch months with buttons or PageUp and PageDown, move between days with the arrow keys. Dates are YYYY-MM-DD strings, month and weekday names come from Intl. Only a small client island runs.

Preview

December 2026
SundayMondayTuesdayWednesdayThursdayFridaySaturday

2026-12-15

Installation

npx shadcn@latest add @gooseui/calendar
pnpm dlx shadcn@latest add @gooseui/calendar
yarn dlx shadcn@latest add @gooseui/calendar
bunx --bun shadcn@latest add @gooseui/calendar

Usage

"use client"

import * as React from "react"
import { Calendar } from "@/components/ui/calendar"

export default function Example() {
  const [date, setDate] = React.useState<string | null>("2026-12-15")
  return <Calendar value={date} onValueChange={setDate} />
}

Examples

Date range

Click the start, then the end. A third click starts a new range. Weeks start on Monday here.

December 2026
MondayTuesdayWednesdayThursdayFridaySaturdaySunday

2026-12-10 - 2026-12-17

<Calendar
  mode="range"
  weekStartsOn={1}
  value={range}
  onValueChange={setRange} // { from?: string; to?: string }
/>

Limits and disabled days

minDate and maxDate bound the selectable days, disabledDates removes single days.

December 2026
SundayMondayTuesdayWednesdayThursdayFridaySaturday
<Calendar
  minDate="2026-12-08"
  maxDate="2027-01-20"
  disabledDates={["2026-12-24", "2026-12-25"]}
  name="date" // hidden input for forms
/>

Keyboard

Arrow keys move by a day or a week, Home and End go to the week edges, PageUp and PageDown change the month, Shift with them changes the year. Enter or Space selects.

Props

PropTypeDefaultDescription
mode"single" | "range""single"Select one date or a range
valuestring | null | { from?: string; to?: string }-Selected date or range; makes the calendar controlled
defaultValuestring | null | { from?: string; to?: string }-Initial selection of an uncontrolled calendar
onValueChange(value) => void-Called when the selection changes
defaultMonthstring-Month shown first, YYYY-MM or YYYY-MM-DD
minDatestring-Earliest selectable day, YYYY-MM-DD
maxDatestring-Latest selectable day, YYYY-MM-DD
disabledDatesstring[]-Days that cannot be selected
namestring-Adds hidden form inputs: name, or name-from and name-to in range mode
localestring"en-US"BCP 47 locale for month and weekday names
weekStartsOn0 | 1 | 2 | 3 | 4 | 5 | 60First day of the week: 0 is Sunday, 1 is Monday
labelsPartial<CalendarLabels>-Texts for screen readers: previousMonth, nextMonth