Framer's Magic Motion
nan.fyi·15w·
Discuss: Hacker News

November 22, 2022

A guide on recreating framer’s magical layout animations.

My favourite part about Framer Motion by far is its magical layout animations—slap on the layout prop to any motion component, and watch as that component seamlessly transitions from one part of the page to the next:

<motion.div layout />

function

hello

left-paren

(

right-paren

)

left-curly

{

console

dot

.

log

left-paren

(

hello, world!

right-paren

)

right-curly

}

When you click on “Hide types”, the squares seamlessly move from one position to the next.

In this post, I want to dive deep into the techniques that allow these layout animations to happen. Specifically, we’ll go over concepts like:

Layout changes, what they are and when they occur; 1.

**CSS-based …

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help