Calendar

A component that lets users select and modify dates effortlessly.

@react-day-picker @lucide/react

Installation


1

Install the following dependencies:

npx shadcn@latest add https://sbthemes-storev2.vercel.app/r/calendar.json

About

The Calendar component leverages React DayPicker for its core functionality.

_

Customization

Refer to the React DayPicker docs for detailed guidance on customizing the Calendar component.

_

Date Picker

The <Calendar> component can be used to build a date picker. Learn more on the Date Picker .

_

Examples


Range Calendar

Month and Year Selector

Date of Birth Picker

Date and Time Picker

Natural Language Picker

This component relies on the chrono-node library for parsing dates from natural language text.


API Reference

The Calendar component is based on react-day-picker and supports all of its props. And adds:

PropTypeDefault
showOutsideDaysbooleantrue
captionLayoutlabel , dropdownlabel
buttonVariantprimary, secondary, outline, error, success, ghost,linkghost
formattersPartial<DayPickerFormatters> -
componentsPartial<DayPickerComponents>-