DayPicker comes with a minimal style inspired by MacOS date pickers, designed to be extended and customized.
You can also use your own styles, or use a CSS framework like Tailwind CSS or Bootstrap to style the calendar.
Using the Default Styles
To start with the included styles, import react-day-picker/style.css
into your app. This will add the .rdp
class names used by DayPicker.
Using a bundler or a React framework
If you are using a React framework, such as Next.js or Gatsby, or a bundler like Webpack with css-loader, import the CSS file from your app's main JavaScript or TypeScript file:
Importing from a CDN
If you are using a CDN, add the following link to your HTML file:
Importing the CSS Module
When using CSS modules, you can import style.module.css
. Pass the class names to the classNames
prop.
Dark/Light Mode
TODO: this section is still incomplete.
CSS Variables
The default styles use CSS variables to make it easier to customize the base appearance of the calendar. You can override the CSS variables to change the appearance of the calendar.
The following table lists the CSS variables used by DayPicker:
TODO: this section is still incomplete.
Custom Styles
Use the classNames
prop to use other classnames instead of the default ones.
Tailwind CSS
TODO: this section is still incomplete.
Custom CSS
Inline Styles
To change the appearance of any DayPicker element via inline-styles use the styles
prop.
Using inline styles won't override the default class names. Mouse hover effects cannot be styled inline.