motion icon indicating copy to clipboard operation
motion copied to clipboard

Noob question about animating components

Open slashlosko opened this issue 6 years ago • 3 comments

Hi, I have a noob question. I discovered this awesome project an hour ago, and I've seen that it can animate HTML tags and SVGs (pretty dope). I'm using the Bumbag UI Kit to create my site, and I have premade components like buttons, input field, cards, etc... can I animate those somehow?

Edit: Also, could animating premade components be a feature in the future?

Thank you, and sorry if I'm using this section wrongly.

slashlosko avatar Sep 26 '20 20:09 slashlosko

Seems that there is a motion.custom() that can be used. Found it digging in issues, but couldn't find it in the documentation.

Found a codesandbox where it works, but might be a reason that it isn't documented: codesandbox. Stackoverflow

Related #565

simjes avatar Sep 26 '20 20:09 simjes

Thank you Simon, it works with other components, but not with the Bumbag UI Kit... When you put the app code in the BumbagProvider component, framer motion doesn't work at all. I don't know if it's an issue with framer motion itself, or the Bumbag kit.

Anyway, if someone knows why it doesn't work, please reply :) Thank you Simon, again.

slashlosko avatar Sep 27 '20 22:09 slashlosko

The component you want to animate has to accept a ref prop so Framer Motion can access the underlying element. So it would be worth looking into whether Bumbag components accept this, if not then they're incompatible.

mattgperry avatar Sep 28 '20 07:09 mattgperry