# Top nav API

> Explore the API of Cimpress UI's top nav component.

Source: https://ui.cimpress.io/components/top-nav/api/

## Import

The top nav component consists of two main components that work together:

```tsx
import { TopNav, TopNavItem } from '@cimpress-ui/react';
```

## Accessibility notes

Top nav renders a [navigation landmark](https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/examples/navigation.html).

## API reference

### TopNav

Displays horizontal navigation, typically below the app header.

See [top nav usage guidelines](https://ui.cimpress.io/components/top-nav/).

**Props: `TopNavProps`**

- `children` (required): `ReactNode`

  The contents of the top navigation. Must be one or more of `<TopNavItem>`.

### TopNavItem

Renders a single navigation item within `TopNav`.

**Props: `TopNavItemProps`**

- `children` (required): `StringLikeChildren`

  The text to display as the navigation item label.

- `href` (required): `string`

  A URL to link to.

- `isActive`: `boolean`

  Whether the navigation item represents the current page.

- `routerOptions`: `undefined`

  Options for the configured client side router.

- `hrefLang`: `string`

  Hints at the human language of the linked URL.
  See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).

- `target`: `HTMLAttributeAnchorTarget`

  The target window for the link. See
  [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).

- `rel`: `string`

  The relationship between the linked resource and the current page. See
  [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).

- `download`: `string | boolean`

  Causes the browser to download the linked URL. A string may be provided to suggest a file name.
  See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).

- `ping`: `string`

  A space-separated list of URLs to ping when the link is followed. See
  [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).

- `referrerPolicy`: `HTMLAttributeReferrerPolicy`

  How much of the referrer to send when following the link. See
  [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).
