How to animate an expanding sidebar in After Effects
UI animation
4 min read
What you’ll learn
The chosen rectangle origin determines where size changes grow from.
Origin controls require a MotionUI rectangle rig, identified by its RectControl layer.
Shift-click pins a null at an origin; Option-click parents a null.
Animate an expanding sidebar while keeping its left edge fixed and its contents readable.
You will: Build a left-anchored panel and compare rectangle origins.
Prerequisites: macOS or Windows, MotionUI, After Effects, a panel design
How do you animate a left-anchored UI panel?
Step 1: Prepare the panel in After Effects
Open the MotionUI app and access plugin setup from the app. MotionUI is a desktop app for macOS and Windows by HIVER connecting Figma, After Effects, Claude Code and Codex. Use the MotionUI app as your entry point for this workflow.
If your panel starts in Figma, use MotionUI’s direct Figma to After Effects import. You can also start with artwork already in After Effects.
For this example, prepare a navigation sidebar with a background rectangle, icons and text labels, plus an adjacent content area. Keep the background and text on separate layers so you can animate their appearance independently.
Expected result: Your composition contains a sidebar background you can resize without scaling its labels.
Step 2: Select the MotionUI rectangle rig
Select the MotionUI rectangle rig identified by its RectControl layer. Open the Rectangle tab. If your background is an unrelated shape layer, create or convert the rectangle with the MotionUI rectangle tools first.
Check that the selected rig belongs to the sidebar background before changing its origin. The rectangle rigs help page documents the origin controls and null gestures used here.
Use the rig’s width and height controls for expansion. Avoid editing rectangle path points when the rig already controls size.
Expected result: You have the correct rectangle rig selected and can choose its growth origin.
Step 3: Choose the left-center origin
In the Rectangle tab, click the left-center origin point. Adjust the rectangle’s width and preview the result. For a sidebar expanding toward the adjacent content area, left-center is the useful starting choice.
The nine origins represent the corners, edge centers and center of the rectangle. Choose according to the point you want the rectangle to grow from:
Top-left, top-center, top-right: Choose a point along the top edge.
Left-center, center, right-center: Choose a point along the horizontal middle.
Bottom-left, bottom-center, bottom-right: Choose a point along the bottom edge.
To compare anchor behavior, preview the same width change with left-center, center and right-center. Look for rightward growth, growth on both sides, and leftward growth respectively. Restore left-center for the sidebar.
Expected result: The sidebar grows from its left edge. If you later animate height too, compare left-center with top-left to decide whether the vertical center or top corner should remain fixed.
Step 4: Animate the rectangle’s size
Move the playhead to the collapsed state and set a keyframe on the rig’s width control. Move to the expanded state and set a wider value. Keep height unchanged for this sidebar example.
Scrub between the keyframes before refining the easing. Watch the left edge against a stationary element in your composition. Then adjust the keyframe interpolation to suit the motion of the surrounding interface.
For an expanding card, follow the same procedure with width and height. Select a corner origin if the card needs to grow away from that corner.
Expected result: The background changes size from the chosen origin without requiring path point animation.
Step 5: Keep labels and adjacent content readable
Animate text separately from the rectangle’s size. In the sidebar example, leave icons visible in the collapsed state and introduce text labels once the background has enough room for them.
Scrub the transition and check the longest label. Adjust its opacity timing or position if it appears before there is sufficient space. Plan the adjacent content area explicitly: reserve room for the expanded sidebar, or animate that content’s position separately.
Expected result: The panel expansion, label reveal and content placement remain legible throughout the transition.
Step 6: Add an origin null only if needed
Use the origin-point gestures when your animation needs a null at a chosen point. Check the resulting layer relationship before continuing.
Origin-point action | Documented behavior |
|---|---|
Click | Choose the rectangle growth origin |
Shift-click | Pin a null at that origin |
Option-click | Parent a null |
Expected result: Any added null has an intentional relationship to the rig. Preview the size animation again after changing that relationship.
What should you check when troubleshooting?
The origin control does not affect the background: Select the rig’s RectControl layer. Create or convert an unrelated rectangle with MotionUI rectangle tools before retrying.
The sidebar grows in the wrong direction: Reopen Rectangle, choose left-center and preview the width change again.
Labels collide with adjacent content: Delay their reveal or adjust content placement independently of the background.
Movement changes after adding a null: Inspect the resulting layer relationship before adjusting more keyframes.
To show the panel’s construction in a design reveal, add an optional Pins&Grid overlay after the primary UI appears. Update the overlay and check its bounds after changing the artwork.
Need to set up the app first? Follow the MotionUI setup guide for Mac and Windows.