# StatusRow

Follows the status of one payment or task while it runs.

[View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/StatusRow.tsx)

Figma: [Messaging/Status Row](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5227-3981)

## Overview

A status row renders a tinted row with a leading mark, a title over a description, and an optional trailing [StatusChip](/docs/components/status-chip). It announces a change of its text to screen readers, so it can update in place as the task moves on.

## Examples

### Basic

```tsx
import { Spinner, StatusChip, StatusRow } from '@tempoxyz/ds'

export function Demo() {
  return (
    <StatusRow>
      <StatusRow.Icon>
        <Spinner />
      </StatusRow.Icon>
      <StatusRow.Content>
        <StatusRow.Title>Waiting for $10.00</StatusRow.Title>
        <StatusRow.Description>
          Usually under a minute on Tempo. You can leave this page.
        </StatusRow.Description>
      </StatusRow.Content>
      <StatusChip intent="warning" size="small">
        Pending
      </StatusChip>
    </StatusRow>
  )
}
```

[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/StatusRow/Basic.tsx)

### Intent

Set `intent` to `neutral` (default) while the task runs, or `positive` once it is done.

```tsx
import { StatusRow } from '@tempoxyz/ds'
import { CheckCircle } from '@tempoxyz/ds/icons'

export function Demo() {
  return (
    <StatusRow intent="positive">
      <StatusRow.Icon>
        <CheckCircle />
      </StatusRow.Icon>
      <StatusRow.Content>
        <StatusRow.Title>Received $10.00</StatusRow.Title>
        <StatusRow.Description>The funds are in your wallet.</StatusRow.Description>
      </StatusRow.Content>
    </StatusRow>
  )
}
```

[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/StatusRow/Intent.tsx)

## Anatomy

Import the component and assemble its parts.

```tsx
import { StatusRow } from '@tempoxyz/ds'

<StatusRow>
  <StatusRow.Icon />
  <StatusRow.Content>
    <StatusRow.Title />
    <StatusRow.Description />
  </StatusRow.Content>
</StatusRow>
```

## Guidelines

### When to Use

* Follow a deposit, a payment, or an authorization that completes within minutes.
* Confirm in place that the task finished.

### When Not to Use

* Use [Alert](/docs/components/alert) for guidance that is not tied to a running task.
* Use [Toast](/docs/components/toast) to confirm an action briefly and out of the flow.
* Use [ListGroup](/docs/components/list-group) for a list of finished payments.

### Match the Mark to the State

* **Running (neutral):** A spinner, with a chip that names the step.
* **Done (positive):** A check in the positive color, without a chip.

### State the Task and the Wait

**Do:** Name the amount in the title and the expected wait in the description.

```tsx
import { Spinner, StatusRow } from '@tempoxyz/ds'

export function Demo() {
  return (
    <StatusRow>
      <StatusRow.Icon>
        <Spinner />
      </StatusRow.Icon>
      <StatusRow.Content>
        <StatusRow.Title>Waiting for $10.00</StatusRow.Title>
        <StatusRow.Description>Usually under a minute on Tempo.</StatusRow.Description>
      </StatusRow.Content>
    </StatusRow>
  )
}
```

**Don't:** Ask people to wait without saying for what or for how long.

```tsx
import { Spinner, StatusRow } from '@tempoxyz/ds'

export function Demo() {
  return (
    <StatusRow>
      <StatusRow.Icon>
        <Spinner />
      </StatusRow.Icon>
      <StatusRow.Content>
        <StatusRow.Title>Please wait</StatusRow.Title>
        <StatusRow.Description>Something is happening.</StatusRow.Description>
      </StatusRow.Content>
    </StatusRow>
  )
}
```

## Content

### Write the Title and the Description

Start the title with the state and the amount, such as Waiting for $10.00. In the description, give the expected wait and whether people can leave the page.

## Accessibility

A status row renders a `<div>` with the `status` role, so screen readers announce a change of its text politely. The leading mark is hidden.

### Semantics

* **Root (status):** Screen readers announce a change of the text without moving focus.
* **Icon (aria-hidden):** The spinner and the check are hidden, so the title carries the state.

### Your Responsibilities

* **Update the Row in Place (SC 4.1.3):** Change the text of the mounted row, so the status role announces it.

## Related

[StatusChip](/docs/components/status-chip)

Use for the status at the end of the row.

[Spinner](/docs/components/spinner)

Use for the leading mark while the task runs.

[Alert](/docs/components/alert)

Use for guidance that is not tied to a running task.
