# 5.1 Decide from the window size, not the device

> Chapter 5, Adapt across sizes. Section: Read the window. Guide: https://www.designguide.dev/md/05-adapt-across-sizes.md#decide-from-the-window-size-not-the-device

Default

**Rule:** Choose the layout from the width of the window, never from the type of device or the screen orientation.

**Why:** The same app runs in a split view and on a large display. Device type hides the room.  **When not:** Ask about the device only for a hardware feature, such as a camera.

- Read the window width and height, not a device name.
- Pick one class: Compact, Medium, Expanded, or Large.
- Lock the orientation only for a camera or a game ([Rule 5.23](https://www.designguide.dev/r/keep-the-place-when-the-screen-turns.md)).

**Picture:** Do: A tablet in a 540 px split view: width picks one pane. Don't: The same tablet and width. The device type picks two panes.

**See:** [5.23 Keep the place when the screen turns](https://www.designguide.dev/r/keep-the-place-when-the-screen-turns.md)
