Docs
Calendar

Calendar

Calendar component is a versatile date field that empowers users to enter and edit dates with ease. Whether selecting dates for events, appointments, or deadlines, the Calendar provides an intuitive and interactive interface for managing date-related information. It enhances user experience by offering a visual representation of dates and facilitating seamless date input.

SuMoTuWeThFrSa

About

The Calendar component is built on top of React DayPicker.

Installation

yarn add @camped-ui/calendar

Usage

import { Calendar } from "@camped-ui/calendar";
const [date, setDate] = React.useState<Date | undefined>(new Date());
 
return (
  <Calendar
    mode="single"
    selected={date}
    onSelect={setDate}
    className="rounded-md border"
  />
);

See the React DayPicker documentation for more information.

Date Picker

You can use the <Calendar> component to build a date picker. See the Date Picker page for more information.

Examples

Form

Your date of birth is used to calculate your age.