Skip to content

React Motion animation for Accordion Content #1888

Answered by andy-hook
swernerx asked this question in Help
Discussion options

You must be logged in to vote

I guess from what I understand from Framer Motion some kind of state information would be helpful

Yes, you'll need to derive the state manually to feed to framer, you can use the controlled props (value, onValueChange) to do so.

Something like this using AnimatePresence would work (though you can share and consume the accordion value via context or however else you prefer)

https://codesandbox.io/s/framer-motion-accordion-9nup9l?file=/src/App.js

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@swernerx
Comment options

Answer selected by swernerx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants