# nav.item

The title of an item in a collection, opening its page. The link covers the item, so the whole item can be pressed; give the item position: relative

Component: [`<Action>`](https://www.prongs.dev/docs/components/action.md) · Renders: `<a>` · Profile: [UI](https://www.prongs.dev/docs/intents/ui.md)

## Example

```tsx
<Action intent="nav.item" href="/somewhere" pressed={isOn}>Item</Action>
```

## Choosing between neighbours

Find the row that describes your element, and use the intent on the right.

| If it is for… | Use |
|---|---|
| The title of an item in a collection, opening its page. The link covers the item, so the whole item can be pressed; give the item position: relative | `nav.item` (this page) |
| A name in a table or list row | [`nav.entry`](https://www.prongs.dev/docs/intents/nav/entry.md) |
| The title of an item that opens as a whole (rather than [`nav.entry`](https://www.prongs.dev/docs/intents/nav/entry.md)) | `nav.item` (this page) |

## Connections

Declared in the registry, both directions. Where an intent is used in your own code is something check and the gallery see; this site has no app code.

- Built from: [`control.link`](https://www.prongs.dev/docs/intents/ui.md#control-link)

## For registry authors

**Starter intents.** These are the intents `prongs add` puts in your registry, shown in this site’s theme. Yours are your own `registry.ts`: rename, restyle and add to them, and see them with `prongs add gallery`.

What this intent is built from and its entry in `components/prongs/registry.ts`. You only need this to change how it looks or to add an intent like it.

How nav.item resolves, and its definition

Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.

- [`control.link`](https://www.prongs.dev/docs/intents/ui.md#control-link) — Inline text link

  ```
  text-foreground underline decoration-dotted
  decoration-foreground/50 underline-offset-4
  hover:decoration-foreground focus-visible:decoration-solid
  focus-visible:decoration-2 focus-visible:outline-none
  aria-disabled:pointer-events-none aria-disabled:opacity-50
  ```

- `nav.item` (this page) — The title of an item in a collection, opening its page. The link covers the item, so the whole item can be pressed; give the item position: relative

  ```
  text-foreground no-underline hover:text-foreground
  after:absolute after:inset-0 after:rounded-lg after:content-['']
  ```

Final classes

```
decoration-dotted decoration-foreground/50 underline-offset-4
hover:decoration-foreground focus-visible:decoration-solid
focus-visible:decoration-2 focus-visible:outline-none
aria-disabled:pointer-events-none aria-disabled:opacity-50
text-foreground no-underline hover:text-foreground
after:absolute after:inset-0 after:rounded-lg after:content-['']
```

Definition

```ts
'nav.item': {
  kind: 'semantic',
  description: 'The title of an item in a collection, opening its page. The link covers the item, so the whole item can be pressed; give the item position: relative',
  refs: ['control.link'],
  binding: {
    classes: 'text-foreground no-underline hover:text-foreground after:absolute after:inset-0 after:rounded-lg after:content-[\'\']',
  },
  notFor: [{ context: 'a name in a table or list row', instead: 'nav.entry' }],
},
```
