# PageTransition

Supply UI 1.1.0. Layout.

Wraps one page's content (in Next.js, in each `page.tsx`) so going to it is smooth: the old page fades out, this one fades and rises in, and the sidebar, site header and tab bar stay still. Plain multi-page sites need nothing: the kit's CSS does the same. A page opened on its own (a first visit, a reload) fades in by itself, with or without it

Makes going to this page smooth: the page you leave fades out and this one fades and rises in, while the app's sidebar, a site's header and the tab bar stay still. Wrap each page's content in it (in Next.js, in every `page.tsx`, not the layout: a layout stays from page to page, so it never comes or goes). A site of plain pages needs nothing: the kit's CSS does the same there. A page opened on its own (a first visit, a reload) fades in by itself, with or without this.

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `children` (needed) | `ReactNode` |  | The page's content. |

## Without React

Classes: `::view-transition-old(.ui-page)`, `::view-transition-new(.ui-page)`; `@view-transition`

## CSS parts

With the CSS in parts (`/ui/css/`), it needs: `components/page-transitions.css`, besides the ones every page loads.

## Layout: notes

**States.** Layout follows the box it is in, not the window: `Split`, `Grid`, `AppShell` and the site parts stack when their box is narrow, at any width of the window.

**Do**
- Space with `gap` (`Stack`, `Row`, `Grid`), never with margins on children.
- Put the page's sections straight on the page, under their titles; a `Card` is one thing a person picks or acts on.
- Check every screen at 320, 375 and 768 px with the narrow check of rule 10.

**Don't**
- Don't give a box a fixed width, or a `min-height` together with an `aspect-ratio`.
- Don't nest a card in a card.
- Don't put two `<main>`s on a page: a screen shown inside another page takes `Main as="div"`.
