# Sidebar

Supply UI 1.1.0. Layout.

Sidebar and main area; the sidebar becomes a top strip on a phone. They are the page's `<aside>` and `<main>`; a screen shown inside another page (an example, a preview) passes `as="div"` to both, so the page keeps one main

The side column and the main part of an `AppShell`. They are the page's `<aside>` and `<main>`; for a screen shown inside a page that has its own (an example, a preview, a screen in a dialog) pass `as="div"`, so the page keeps one main.

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `as` | `"aside" \| "div"` | `'aside'` | The element it renders: `div` when the page around it already has this element (one `main` per page). |

It also takes the 280 attributes of the element or UI SDK part it renders (`className`, `aria-label`, events…).

## Without React

Classes: `ui-app`, `ui-sidebar`, `ui-main`

## CSS parts

With the CSS in parts (`/ui/css/`), it needs: `components/card.css`, `components/prose.css`, `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"`.
