Introduction & Getting Started
Overview, installation, and quick start guide for react-modular-datepicker.
react-modular-datepicker
A modular, lightweight, and type-safe React datepicker library. Whether you need a fully-featured calendar component or a headless hook to build custom UI layouts, react-modular-datepicker has you covered.
Live Preview: Single Date Selection
SUN
MON
TUE
WED
THU
FRI
SAT
Selected: Fri Oct 02 2026
Key Features
- đī¸ Headless & Modular: Use the
useDateshook for complete layout control, or theCalendarcomponent for ready-to-use UI. - đĒļ Lightweight Footprint: Small bundle size with a pluggable adapter system (defaults to Day.js).
- đĄī¸ Type-safe: Built 100% in TypeScript with comprehensive interfaces.
- đ¨ Fully Customizable: Style everything via Tailwind CSS or custom class names with state deep merging.
- đ Localized: Full internationalization support with custom translations and
firstDayOfWeekcontrol. - ⥠Feature-rich: Single, multiple, and range selection modes, hover preview, min/max bounds, and disabled dates.
Installation
Install react-modular-datepicker and dayjs using your package manager of choice:
npm install react-modular-datepicker dayjsNote on Peer Dependencies:
dayjsis configured as an optional peer dependency. By default,react-modular-datepickeruses the built-inDayjsAdapter. If you use another library (such asdate-fns), you can pass a customDateAdapterto theadapterprop without needingdayjs.
Quick Start
Import the Calendar component and its CSS:
import { useState } from 'react';
import { Calendar } from 'react-modular-datepicker';
import 'react-modular-datepicker/dist/index.css';
export function QuickStartExample() {
const [selected, setSelected] = useState<Date | null>(new Date());
return (
<Calendar
selected={selected}
onChange={(date) => setSelected(date as Date)}
/>
);
}Next Steps
- Explore Core Concepts to learn about
useDatesand the component architecture. - Check out the API Reference for complete component and hook options.
- Browse Recipes for interactive demos of range selection, custom styling, localization, forms, and custom adapters.