# Task row

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

A row that owes you an action: media, a two-line body with a due date, one primary and two outlined icon buttons.

`import { EcoTaskRow, EcoTaskRows } from "vue-ecosphere"`

## Rows

Wrap the rows in EcoTaskRows: it owns the surface and the dividers. Three ranked choices per row.

Vue (vue-ecosphere):

```vue
<EcoTaskRows>
  <EcoTaskRow
    media="01"
    title="Certificate renewal"
    subtitle="api.internal expires in 6 days"
    description="Auto-renewal is off for this domain, so it needs a manual rotation before the expiry date."
    due="Jul 24"
    action-label="Renew now"
    @action="renew"
    @snooze="snooze"
    @dismiss="dismiss"
  />
  <EcoTaskRow
    media="02"
    title="Unassigned reports"
    subtitle="14 items with no owner"
    description="Items sitting unassigned for more than a week stop appearing in weekly summaries."
    due="Jul 22"
    action-label="Assign"
  />
</EcoTaskRows>
```

React (react-ecosphere):

```tsx
<EcoTaskRows>
  <EcoTaskRow
    media="01"
    title="Certificate renewal"
    subtitle="api.internal expires in 6 days"
    description="Auto-renewal is off for this domain, so it needs a manual rotation before the expiry date."
    due="Jul 24"
    actionLabel="Renew now"
    onAction={renew}
    onSnooze={snooze}
    onDismiss={dismiss}
  />
  <EcoTaskRow
    media="02"
    title="Unassigned reports"
    subtitle="14 items with no owner"
    description="Items sitting unassigned for more than a week stop appearing in weekly summaries."
    due="Jul 22"
    actionLabel="Assign"
  />
</EcoTaskRows>
```

## API

Vue (vue-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `title / subtitle` | `string` | — | The top line. |
| `description` | `string` | — | Body sentence; the default slot overrides it. |
| `media` | `string` | — | Avatar text (“01”, initials). The #media slot overrides it. |
| `due / dueLabel` | `string` | — / "Due" | Renders “Due <b>Jul 24</b>”. The #meta slot overrides it. |
| `actionLabel` | `string` | — | The one primary. Name the action, never “OK”. |
| `snooze / dismiss` | `boolean` | true | Show the outlined icon buttons. |
| `snoozeLabel / dismissLabel` | `string` | "Snooze" / "Dismiss" | Their titles; the aria-label adds the row title. |
| `@action / @snooze / @dismiss` | `() => void` | — | Button clicks. The #actions slot replaces all three. |

React (react-ecosphere):

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `title / subtitle` | `string` | — | The top line. |
| `description` | `string` | — | Body sentence; children override it. |
| `media` | `ReactNode` | — | Avatar text (“01”, initials). Any other node replaces the avatar. |
| `due / dueLabel` | `string` | — / "Due" | Renders “Due <b>Jul 24</b>”. The meta prop (ReactNode) overrides it. |
| `actionLabel` | `string` | — | The one primary. Name the action, never “OK”. |
| `snooze / dismiss` | `boolean` | true | Show the outlined icon buttons. |
| `snoozeLabel / dismissLabel` | `string` | "Snooze" / "Dismiss" | Their titles; the aria-label adds the row title. |
| `onAction / onSnooze / onDismiss` | `() => void` | — | Button clicks. The actions prop (ReactNode) replaces all three. |
