Free guideThe newsletter. Real UI fixes by email, and a free 35-page guide to AI design skills.
Ship Better UI

, 1 minute 11 seconds

How do you make a side drawer slide in smoothly?

The rule

Open a drawer with two properties: park it off-screen, slide it in with transform, fade it in with opacity, and never animate its width or height.

Try it

Apply the fix

Prompt for your AI coding tool

Paste it into Claude Code, Cursor or any AI coding tool, then share the page you want fixed.

Review the animations in the interface I share. Make every drawer and panel that slides in move with transform and fade with opacity, and change nothing else.

1. Park it: build the element once at its full size and park it off the edge it comes from, there but out of sight.
2. Slide it in with transform. transform moves an element without changing its size, so the layout never changes.
3. Fade it in with opacity, which sets how see-through it is.

Do not animate width or height. Each new width makes the browser measure and place every box on the page again, on every frame, and smooth motion needs 60 frames a second, about 16.7 ms each. When it cannot keep up, frames are dropped and the motion stutters.

Keep the content, the timing and the look of the open state. When you are done, list each animation you changed: what it animated before and what it animates now.

More prompts like this in the free guide 

The problem

The video opens an example invoices app. Tap the Acme Studio row and a side drawer opens on the right, while the list squeezes left to make room. This version grows the drawer's width on every frame, and each new width makes the browser measure and place every box again: that is the layout. A frame is one still picture, and smooth motion needs 60 a second, about 16.7 ms each. The work takes too long, so 7 frames are dropped and the drawer stutters.

The fix

Same drawer, same timing. Move it, never resize it.

  1. Park it. Build the drawer once at its full size and park it past the right edge of the screen, there but out of sight.
  2. Slide it. Move it in with CSS transform, which moves things without changing their size.
  3. Fade it. Fade it in with opacity, which sets how see-through it is.

Why it works

Transform moves the drawer without resizing it, so the layout never changes. Nothing on the page is measured again: the list stays where it was and the drawer slides in over it. Opacity only changes how see-through the drawer is. In the video, every frame of the new open lands under the 16.7 ms line, and none are dropped.

How to apply it

Before you animate a drawer, check which properties move. Move with transform, fade with opacity, and leave width and height alone. If it has to open, build it at its final size first and park it out of sight until it is needed.

Free guide · 35 pages

Get fixes like this by email

Join the newsletter and get the 35-page guide to AI design skills: the skills, the order to use them in, and prompts to copy.

Watch it on

More on motion