# Page header

Source: https://ecosphere.dev/docs/layout/page-header (Ecosphere 1.5). Install `vue-ecosphere` for Vue 3 or `react-ecosphere` for React 18.2+/19: same components, props, markup and stylesheet.

Eyebrow, title, one sentence of what the screen governs, and the actions on the same baseline.

`import { EcoPageHeader } from "vue-ecosphere"`

## With a subtitle and three actions

Keep one primary: the act the screen exists for.

Vue (vue-ecosphere):

```vue
<EcoPageHeader
  eyebrow="Institution setup"
  title="Classes, sections and rooms"
  description="Everything downstream reads from here — the timetable validator, the registers, the report-card template and what guardians see in their app."
>
  <template #actions>
    <EcoButton variant="tertiary">Import from CSV</EcoButton>
    <EcoButton>Add a section</EcoButton>
    <EcoButton variant="primary" icon="add-line">New class</EcoButton>
  </template>
</EcoPageHeader>
```

React (react-ecosphere):

```tsx
<EcoPageHeader
  eyebrow="Institution setup"
  title="Classes, sections and rooms"
  description="Everything downstream reads from here — the timetable validator, the registers, the report-card template and what guardians see in their app."
  actions={
    <>
      <EcoButton variant="tertiary">Import from CSV</EcoButton>
      <EcoButton>Add a section</EcoButton>
      <EcoButton variant="primary" icon="add-line">New class</EcoButton>
    </>
  }
/>
```

## Title only, scoped by a cycle

A scope control belongs in the header, ahead of the buttons.

Vue (vue-ecosphere):

```vue
<EcoPageHeader eyebrow="Admissions" title="Applicants">
  <template #actions>
    <!-- a scope control goes ahead of the buttons -->
    <div class="cycsel">
      <button class="cycbtn" type="button" aria-expanded="false">
        <span class="cycbtn__k">Cycle</span><span>2027–28</span>
        <svg class="cycbtn__c" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6" /></svg>
      </button>
    </div>
    <EcoButton variant="primary">Record an enquiry</EcoButton>
  </template>
</EcoPageHeader>
```

React (react-ecosphere):

```tsx
<EcoPageHeader
  eyebrow="Admissions"
  title="Applicants"
  actions={
    <>
      {/* a scope control goes ahead of the buttons */}
      <div className="cycsel">
        <button className="cycbtn" type="button" aria-expanded="false">
          <span className="cycbtn__k">Cycle</span><span>2027–28</span>
          <svg className="cycbtn__c" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6" /></svg>
        </button>
      </div>
      <EcoButton variant="primary">Record an enquiry</EcoButton>
    </>
  }
/>
```

## API

Vue (vue-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `title` | `string` | — | Display face at 25px (ptitle). #title slot overrides it. |
| `eyebrow` | `string` | — | Small caps label above the title. |
| `description` | `string` | — | One sentence, capped at 64ch: say what depends on this screen. Leave it off when the title is self-evident. |
| `as` | `"h1" \| "h2" \| "h3"` | "h2" | Heading level of the title. |
| `#actions` | `slot` | — | One primary and the rest secondary or tertiary; they wrap rather than compress. |

React (react-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `title` | `ReactNode` | — | Display face at 25px (ptitle): text or a node. |
| `eyebrow` | `ReactNode` | — | Small caps label above the title. |
| `description` | `ReactNode` | — | One sentence, capped at 64ch: say what depends on this screen. Leave it off when the title is self-evident. |
| `as` | `"h1" \| "h2" \| "h3"` | "h2" | Heading level of the title. |
| `actions` | `ReactNode` | — | One primary and the rest secondary or tertiary; they wrap rather than compress. |
