WFP logoDesign System

A date picker component that allows users to select dates.

February 2026

About

The Calendar component is built on top of React Day Picker, a flexible date picker library for React.

Installation

pnpm dlx shadcn@latest add https://designsystem.wfp.org/r/calendar.json

Usage

import { Calendar } from "@/components/ui/calendar";
const [date, setDate] = useState<Date | undefined>(new Date());

<Calendar
  mode="single"
  selected={date}
  onSelect={setDate}
  className="rounded-md border"
/>;

Examples

Date range

June 2025
July 2025

Use the mode="range" prop to allow users to select a date range.

Multiple dates

February 2026

Use the mode="multiple" prop to allow users to select multiple dates.

With dropdown

February 2026

Use captionLayout="dropdown" to display month and year as dropdown menus.

Disabled dates

February 2026

Use the disabled prop to disable specific dates or date ranges. You can disable weekends, specific dates, or date ranges.

API reference

This component is built on top of React Day Picker.  See the React Day Picker documentation for the full API reference.