# Findings

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

A short list of observations beside a chart or a summary figure: a toned icon, one plain statement and an optional link to the rows behind it.

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

## Beside a chart

The four tones, two with a link to their rows. Below about 900px, stack the chart and the findings.

Vue (vue-ecosphere):

```vue
<EcoFindings :items="[
  { tone: 'danger', text: '**West** sales fell **18%** from April, the largest drop of any region.',
    link: { label: 'See 42 orders', href: '#west-orders' } },
  { tone: 'warning', text: '**6 orders** have no region recorded and are left out of these totals.',
    link: { label: 'See 6 orders', href: '#unassigned' } },
  { tone: 'success', text: 'Every region met its monthly target in March and April.' },
  { text: '**North** brings in 43.6% of revenue, about the same share as last quarter.' },
]" />
```

React (react-ecosphere):

```tsx
<EcoFindings
  items={[
    { tone: "danger", text: "**West** sales fell **18%** from April, the largest drop of any region.",
      link: { label: "See 42 orders", href: "#west-orders" } },
    { tone: "warning", text: "**6 orders** have no region recorded and are left out of these totals.",
      link: { label: "See 6 orders", href: "#unassigned" } },
    { tone: "success", text: "Every region met its monthly target in March and April." },
    { text: "**North** brings in 43.6% of revenue, about the same share as last quarter." },
  ]}
/>
```

## Compact, inside a card

Vue (vue-ecosphere):

```vue
<EcoFindings compact label="Stock check findings" :items="stock" />
```

React (react-ecosphere):

```tsx
<EcoFindings compact label="Stock check findings" items={stock} />
```

## Compact, under a summary figure

## API

Vue (vue-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `items` | `EcoFinding[]` | — | { tone?, text, link? }. Wrap the figure that matters in **…** to set it in bold. Problems first; five or fewer. |
| `tone` | `"danger" \| "warning" \| "success" \| "neutral"` | "neutral" | Each tone has its own icon and sr word (Problem, Check, Good, Note), never colour alone. |
| `link` | `{ label, href }` | — | Opens the rows the finding is about. Gets aria-describedby pointing at its statement. |
| `label` | `string` | "Findings" | aria-label of the list. Without it, a passed aria-labelledby names the list instead. |
| `compact` | `boolean` | false | Bare 16px icons and 13px statements, inside a card or under a KPI figure. |

React (react-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `items` | `EcoFinding[]` | — | { tone?, text, link? }. Wrap the figure that matters in **…** to set it in bold. Problems first; five or fewer. |
| `tone` | `"danger" \| "warning" \| "success" \| "neutral"` | "neutral" | Each tone has its own icon and sr word (Problem, Check, Good, Note), never colour alone. |
| `link` | `{ label, href }` | — | Opens the rows the finding is about. Gets aria-describedby pointing at its statement. |
| `label` | `string` | "Findings" | aria-label of the list. Without it, a passed aria-labelledby names the list instead. |
| `compact` | `boolean` | false | Bare 16px icons and 13px statements, inside a card or under a KPI figure. |
