# SiteMenu

Supply UI 1.1.0. Showing things.

The header of a public page or site, inside the page's `Container` (see The page): the brand (a plain name is drawn as a `Logo`), the main links (the same `items` as `NavigationMenu`) and one or two `actions` in one line. It floats: at the top of the page it sits on the page, and once the page scrolls it stays as a solid bar (`sticky={false}` leaves it in place). Links to places on the page (`#rooms`) follow the reader: the section in view is marked and the mark slides between links. When its box is narrower than 48rem it folds into a `Burger` that opens a floating menu: the links set large and numbered, rising in one after another, and a picture painted from `menuTitle` (the site's name) with the actions under it. A link to a place on the page closes the menu, then scrolls there. Use it rather than putting `NavigationMenu` in a `Row` yourself. `SiteMenu` is its phone menu alone (the two-line button and the panel it opens): for a bar of your own, put it at the bar's end and show it where the links do not fit. Never build another menu for a phone

A site's menu on a small screen: a two-line button that opens a floating panel from the end of the screen, with the links set large and numbered, rising in one after another, and a painted picture with the actions at its foot. A link to a place on the page closes the menu first, then scrolls there. <SiteHeader> uses it; use it alone in a bar of your own, at the bar's end, shown where the links do not fit

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `items` (needed) | `NavigationEntry[]` |  | The links, as for <SiteHeader>: plain links are set large and numbered, groups of links are listed under their name. |
| `title` (needed) | `string` |  | The menu's title: the site's name. It also paints the picture at the foot of the menu. |
| `actions` | `ReactNode` |  | At the foot, under the picture: a button or two ("Sign in", "Book a stay"). |
| `aria-label` | `string` |  | What the navigation is: "Main". |
| `className` | `string` |  | Classes of the two-line button that opens it. |
| `current` | `null \| string` | `null` | The link of the place the reader is in (`#rooms`): it is marked with a dot. A link with `current` is marked too. |
| `link` | `ReactElement<Record<string, unknown>, string \| JSXElementConstructor<any>>` |  | The app's own link component, as for <NavigationMenu>. |

## Without React

Classes: `header.ui-site-header` > `.ui-site-header-bar`

## CSS parts

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

## Showing things: notes

**States.** Lists, tables and boards have three more states besides their content: empty (`Empty`, with the first action inside), loading (`Skeleton`) and failed (`Alert tone="danger"`). A chosen row shows in ink, never in the brand colour.

**Do**
- Put numbers, dates and codes in `ui-mono` (in a table cell, `ui-num`, which also aligns them).
- Let a `Table` turn into blocks on a phone; give it `scroll` only when it is read down its columns.
- Show a status in words and colour together (`Badge tone="success"` with "Paid"), never colour alone.

**Don't**
- Don't put a card round a `Table`, `List`, `Cells`, `Calendar` or `Empty`: they draw their own box.
- Don't truncate a name or a price to fit; let it wrap. Truncate only file names and addresses.
- Don't use the status colours (success, warning, danger, info) for anything but those meanings.
