The true power lies in code but it's a mountain to climb. Learn in this order:
1. Try overrides
2. A bit HTML/CSS
3. A bit JS/React
4. animate, variants, transition
5. useCycle
6. Revisit overrides
7. motionValue
8. More cool stuff
Thread (14 posts) 👇
Add a Frame. Add an "override" from properties panel. Preview it. Click "Edit code". Relax if the code looks scary. Change some values and see how it affects the result.
Useful mental model: think of the code editor as an enlarged, fancy property control.
Chances are that you've already done this step.
No need to be an expert. Knowing below is enough to get started:
- What do HTML and CSS do?
- The format of HTML tags
- inline styles
- common CSS properties such as opacity, width, height, transform
- JS: variables, objects, arrays, functions
- React: JSX, components, props (no need to learn state yet)
There's a lot here. But don't panic! You only need to learn a little bit at a time to get going.
Create a component that draws a blue square (Frame). Try various props to change its look.
Bonus: later you'd be able to prototype with just React!
codesandbox.io
We can use "times" to control the precise timing of these keyframes. Or coordinate the timing of multiple animations: delay, sequence, stagger etc.
Also try things like "staggerChildren" or "yoyo"
useCycle, when combined with events like onTap, makes the animations interactive. We can use it to cycle through animation states defined with "animate" and "variants" props.
A typical use case is a toggle which has "on" and "off" states, but we can do a lot more!
This will take you surprisingly far. You'll be able to create fairly complex interactions.
Did you realize overrides are just a way to set the props of components on the canvas?
Overrides are a clever idea: leverage both the convenience of design canvas and the power of code.
We can use overrides on components downloaded from Framer Store too!
"Set it and forget it". All we need is to define how to transform values and set it via props.
When combined with gestures such as drag or scroll, we can create advanced interactions such as card swiping, parallax.
We can uses these in overrides too!