Getting Started with Styled
The styled package provides pre-styled date picker components with built-in CSS. No CSS framework required.
Installation
npm install react-date-range-picker-styled
After installing, import the CSS in your app entry point:
import "react-date-range-picker-styled/rdrp-styles.css";Quick Start
import { useState } from "react";import { DatePicker } from "react-date-range-picker-styled";import "react-date-range-picker-styled/rdrp-styles.css";
function Basic() { const [value, setValue] = useState<Date | null>(null);
return <DatePicker value={value} onChange={setValue} />;}What’s Included
| Component | Description |
|---|---|
DatePicker | Single date selection with popup calendar |
DateRangePicker | Date range selection with dual calendar and presets |
DateTimePicker | Date + time selection with time scroll panel |
DateRangeTimePicker | Date range + time selection |
TimePicker | Standalone time selection |
All components support:
- Controlled value with
value/onChange - Keyboard navigation
- Dark mode via CSS variables
- 4 sizes:
small,medium,large,x-large - Compound Component API for customization
TypeScript Types
All configuration and data types are re-exported from the package — no need to install the headless package separately:
import type { Locale, DatePickerSize, TimeConfig, MinuteStep, SecondStep, TimePrecision, HourFormat, TimePeriod, CaptionLayout, WeekDay, DateRangePreset, CalendarMonth, DayProps,} from "react-date-range-picker-styled";These types are useful for:
Locale— Custom locale overrides (weekday names, button labels, date formatting)DatePickerSize— Typing thesizeprop ("small"|"medium"|"large"|"x-large")TimeConfig— Configuring time picker precision, format, and stepsDateRangePreset— Defining presets forDateRangePicker/DateRangeTimePickerCalendarMonth,DayProps— Custom rendering with Compound Components
See Headless Types for detailed type definitions.
Next Steps
- DatePicker — Single date selection
- DateRangePicker — Date range with presets
- Compound Components — Customize internal structure
- CSS Variables — Theme with CSS variables
- Dark Mode — Dark theme support