# 5.7 Keep state across a layout change

> Chapter 5, Adapt across sizes. Section: Keep one product. Guide: https://www.designguide.dev/md/05-adapt-across-sizes.md#keep-state-across-a-layout-change

Hard

**Rule:** Keep the scroll place, the selection, open panels, and typed text when the layout changes.

**Why:** A resize or a turn must not cost a person their place.

- Hold state above the layout, not inside one layout.
- Pass all data to each part, even data a small layout hides.
- Reopen a flow at the same step with the answers in place.

**Picture:** Size pair (Phone, 375; Window, 1280): The open order and the typed note stay when the window narrows from 1280 to 375.
