# Page header

> Title, description and one primary action: the action the page exists for.

- Group: Navigation
- Status: stable
- Aliases: header-actions
- HTML page: https://design.ipmnx.com/components/page-header/
- Spec: https://design.ipmnx.com/design/#nx-page-header

## Preview

**Posts**

```html
<header class="nx-pagehead">
  <div class="nx-pagehead__row">
    <div class="nx-pagehead__text">
      <h1 class="nx-pagehead__title">Posts</h1>
      <p class="nx-pagehead__desc">What IPM Facility publishes, on
          every platform.</p>
    </div>
    <div class="nx-pagehead__actions">
      <button type="button"
          class="nx-btn nx-btn--ghost">Export</button>
      <button type="button"
          class="nx-btn nx-btn--primary">Write post</button>
    </div>
  </div>
</header>
```

```tsx
<NxPageHeader
  title="Posts"
  description="What IPM Facility publishes, on every platform."
  primaryAction={<NxButton>Write post</NxButton>}
  secondaryActions={[
    <NxButton key="x" variant="ghost">Export</NxButton>,
  ]}
/>
```

## API

### React props (NxKit)

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `title` | `ReactNode` |   | yes | The page's h1. |
| `description` | `ReactNode` | `undefined` |   | One line of context. |
| `primaryAction` | `ReactNode` | `undefined` |   | Exactly one primary button. |
| `secondaryActions` | `ReactNode[]` | `[]` |   | At most 2 (dev-warns); more go into a menu. |
| `breadcrumb` | `ReactNode` | `undefined` |   | An NxBreadcrumb above the title. |

### Classes

| Class | Description |
| --- | --- |
| `.nx-pagehead` | Header block |
| `.nx-pagehead__actions` | Secondary then primary, wraps on narrow screens |

## Accessibility

- Renders the page's only h1.

## Do / Don't

- Do: One primary per view.
- Don't put two primary buttons in the header.

## Related

- [Context switcher](https://design.ipmnx.com/components/context-switcher.md)
- [Button](https://design.ipmnx.com/components/button.md)
- [Breadcrumb](https://design.ipmnx.com/components/breadcrumb.md)

---

Source: registry.js (NX Design System)
