Frontory

Open code, practice, and notes →

Download source with English comments · for reading

Motion · 08 Measuring Layout

Series contents · Technology map

Stage: Layout and Presence · Editable example · Storage ID: motion-step-08

Goals and learning outcomes

Prerequisites

Prepare the results of the Orchestration and Stagger exercises from Unit 7, “Child Entrance Order”.

Key concepts and explanations

Layout

layout animates the difference between the previous and next layouts. React and CSS determine the final document layout.

Transform interpolation

Distinguish visual movement from actual layout. Size changes can distort child content.

Practice setup

First check the execution scope guidance on the example screen. The following describes the environment needed to extend the assignment in a separate project. The existing motion-01·02·03 examples are limited examples based on Motion JS animate. For React layout, AnimatePresence, and hooks exercises, install motion in a separate local React project and import from motion/react. Do not assume JSX runs directly in the editor; preserve CSP and isolation.

The linked example is a starting point. It does not implement every task below. Complete work beyond its supported scope in a separate project.

Practice tasks

  1. In src/day-8.tsx of a separate exercise project, add layout to motion cards and change the number of Grid columns. Use the existing Unit 1·14·28 examples only as starting points.
  2. Input condition: Toggling between 1 and 3 columns. Baseline: 3 columns. Run under the baseline condition, then record observations and errors in notes/day-8.md.
  3. Variable to change: Column count; new value: 1 column. Run again with the same input path. Deliverable to save: A record of final layout and text observations during the transition. Hypothesis to test: The layout changes and cards interpolate to their new positions. Compare it with the actual results and record whether they agree and the causes of any differences.

Variables to observe

VariableBaselineChangeExpected change / hypothesis
Column count3 columns1 columnThe layout changes and cards interpolate to their new positions.

Predictions in this table are not measured results. Change one condition at a time and record why the actual result differs.

Completion criteria

Self-check

  1. Which processing stage does Layout affect in this exercise? Input case: Toggling between 1 and 3 columns.
  2. Variable to change: Column count. Hypothesis to test: The layout changes and cards interpolate to their new positions. Did the actual results agree with the hypothesis? Explain your evidence in terms of Transform interpolation.

Official references

Linked example and execution scope

Example source · Runtime environments and limits

Interactive Measuring Layout experiment with cleanup of the resources used.

Source code and records are not overwritten automatically. Resetting an existing example also preserves your notes.

Next learning

Previous: Child Entrance Order · Next: Stable Keys

Open code, practice, and notes →