# NavItem

Supply UI 1.1.0. Layout, part of `Nav`.

Links in the sidebar. With Next.js `<Link>`, use `className={navItemClass}` and `aria-current="page"`. `Nav variant="rail"`: icons only in a narrow column, the chosen one in ink; give each item an `aria-label` and a `Tooltip`

One link in a Nav

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `active` | `boolean` |  | Marks it as the page the person is on (`aria-current="page"`). |

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

## Without React

Classes: `ui-nav`, `ui-nav-item`, `ui-nav--rail`

## CSS parts

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

## In the examples

- A sidebar with sections: Pick a section; its numbers change beside it (https://www.supply.family/ui/#scene-studio-sidebar)
- Icons in a rail: A narrow column, a name on hover, ink for where you are (https://www.supply.family/ui/#scene-rail)

## 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"`.
