# Hero

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

The dashboard moment: gradient wash with noise, a count, on-fill CTAs and a glass follow-ups panel.

`import { EcoHero, EcoHeroPanelRow } from "vue-ecosphere"`

## Hero

One gradient wash per screen, and never behind data. The key words of the line are set in white; the rest stays at 70%.

Vue (vue-ecosphere):

```vue
<EcoHero
  eyebrow="Saturday, 8 August"
  :count="14"
  unit="requests"
  line="are waiting on"
  highlight="an owner"
  sub="Ordered by how long they have been open. Four have been waiting more than a week."
  :panel-count="6"
  panel-label="Reminders due"
>
  <template #cta>
    <EcoButton variant="onfill" icon-end="arrow-right-line">Assign them</EcoButton>
    <EcoButton variant="ghostfill">View all requests</EcoButton>
  </template>
  <template #panel>
    <EcoHeroPanelRow initials="CR" name="Certificate renewal" hint="api.internal · 6 days" />
    <EcoHeroPanelRow initials="UR" name="Unassigned reports" hint="14 items · no owner" />
    <EcoHeroPanelRow initials="SF" name="Stale feature flags" hint="9 flags · 90 days" />
  </template>
  <template #panel-foot>
    <EcoButton variant="ghostfill" size="sm" wide>View all reminders</EcoButton>
  </template>
</EcoHero>
```

React (react-ecosphere):

```tsx
<EcoHero
  eyebrow="Saturday, 8 August"
  count={14}
  unit="requests"
  line="are waiting on"
  highlight="an owner"
  sub="Ordered by how long they have been open. Four have been waiting more than a week."
  panelCount={6}
  panelLabel="Reminders due"
  cta={
    <>
      <EcoButton variant="onfill" iconEnd="arrow-right-line">Assign them</EcoButton>
      <EcoButton variant="ghostfill">View all requests</EcoButton>
    </>
  }
  panel={
    <>
      <EcoHeroPanelRow initials="CR" name="Certificate renewal" hint="api.internal · 6 days" />
      <EcoHeroPanelRow initials="UR" name="Unassigned reports" hint="14 items · no owner" />
      <EcoHeroPanelRow initials="SF" name="Stale feature flags" hint="9 flags · 90 days" />
    </>
  }
  panelFoot={<EcoButton variant="ghostfill" size="sm" wide>View all reminders</EcoButton>}
/>
```

## API

Vue (vue-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `eyebrow` | `string` | — | On-fill eyebrow, usually the date. |
| `count / unit` | `number \| string / string` | — | The figure and its unit (hero__n, hero__unit). |
| `line` | `string` | — | The line under the count, before the highlighted part. |
| `highlight` | `string` | — | The words set in white (hi). |
| `lineEnd` | `string` | — | Text after the highlighted part. Or write the whole line in the #line slot. |
| `sub` | `string` | — | One or two sentences under the line. |
| `as` | `"h1" \| "h2" \| "p"` | "h1" | Element for the line. |
| `panelCount / panelLabel` | `number \| string / string` | — | Head of the glass side panel. |
| `#cta` | `slot` | — | On-fill buttons: onfill and ghostfill only. |
| `#panel / #panel-foot` | `slot` | — | Panel rows (EcoHeroPanelRow) and a footer action. |
| `EcoHeroPanelRow` | `name, hint?, initials?, href?` | — | One follow-up row (prow); emits click. Initials derive from the name. |

React (react-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `eyebrow` | `ReactNode` | — | On-fill eyebrow, usually the date. |
| `count / unit` | `number \| string / string` | — | The figure and its unit (hero__n, hero__unit). |
| `line` | `ReactNode` | — | The line under the count, before the highlighted part. A node, with highlight and lineEnd unset, writes the whole line. |
| `highlight` | `string` | — | The words set in white (hi). |
| `lineEnd` | `string` | — | Text after the highlighted part. Or pass the whole line as a node in line. |
| `sub` | `ReactNode` | — | One or two sentences under the line. |
| `as` | `"h1" \| "h2" \| "p"` | "h1" | Element for the line. |
| `panelCount / panelLabel` | `number \| string / string` | — | Head of the glass side panel. |
| `cta` | `ReactNode` | — | On-fill buttons: onfill and ghostfill only. |
| `panel / panelFoot` | `ReactNode` | — | Panel rows (EcoHeroPanelRow) and a footer action. |
| `EcoHeroPanelRow` | `name, hint?, initials?, href?, onClick?` | — | One follow-up row (prow): a button, or a link with href. Initials derive from the name. |
