Skip to main content

Styling

All components use BEM-prefixed CSS classes (rdp-*) and expose CSS custom properties for theming.

CSS Custom Properties

PropertyDefaultDescription
--rdp-font-familysystem-ui, sans-serifFont family
--rdp-font-size14pxBase font size
--rdp-primary#2563ebSelected/highlight color
--rdp-primary-hover#1d4ed8Hover variant
--rdp-primary-light#dbeafeLight variant for range bg
--rdp-bg#ffffffBackground
--rdp-border#d1d5dbBorder color
--rdp-border-radius8pxBorder radius
--rdp-text#111827Text color
--rdp-text-muted#6b7280Muted text
--rdp-cell-size36pxCalendar cell size
--rdp-popover-shadow0 4px 16px rgba(0,0,0,0.12)Popover shadow
--rdp-time-column-height200pxTime column scroll height

Overriding with CSS

.rdp-wrapper {
--rdp-primary: #059669;
--rdp-primary-hover: #047857;
--rdp-primary-light: #d1fae5;
--rdp-border-radius: 12px;
}

Overriding with Tailwind

Pass className to any component and Tailwind classes override default styles due to higher specificity:

<DatePicker className="[&_.rdp-trigger]:rounded-xl [&_.rdp-trigger]:shadow-sm" />

Inline Styles

The style prop is merged into the root wrapper, allowing per-instance overrides:

<DatePicker style={{ width: 320 }} />