Skip to content
Discussion options

You must be logged in to vote

The animate prop in React DayPicker v9 enables animation states, but the actual visual transitions depend on CSS rules.

That's why importing react-day-picker/style.css makes the animations work while also changing your existing shadcn/ui styles.

I would avoid importing the entire stylesheet solely to enable animations.

A cleaner approach is:

  1. Pass animate to the underlying DayPicker through your Calendar component.
  2. Keep the existing shadcn classNames and styles.
  3. Copy only the animation-related rules from the installed version of react-day-picker/style.css into your application's stylesheet.
  4. Scope those rules to your Calendar wrapper to avoid affecting unrelated components.

For example:

<C…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by TheRay432
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants