# HeroVisual

Shows animated streaks and a title beside the steps of a setup flow.

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

Figma: [Content/Hero Visual](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5227-4030)

## Overview

A hero visual renders a dark 520px card with the Tempo wordmark at the top and a title block at the bottom. `step` selects the streaks of the current step, and the next step slides new streaks in.

## Examples

### Basic

Compose a title and a description. The card stays dark in both color schemes.

```tsx
/** Demonstrates HeroVisual in the documentation. @module */
import { HeroVisual, style } from '@tempoxyz/ds'

export function Demo() {
  return (
    <div {...styles.frame()}>
      <HeroVisual step="connect">
        <HeroVisual.Title>Your agent</HeroVisual.Title>
        <HeroVisual.Description>One command, and it can pay its own way.</HeroVisual.Description>
      </HeroVisual>
    </div>
  )
}

namespace styles {
  export const frame = style({ maxWidth: '31.25rem !custom', width: '100% !custom' })
}
```

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

### Steps

Advance `step` with the flow. The title brightens on the steps that complete it.

```tsx
/** Demonstrates HeroVisual in the documentation. @module */
import { Button, HeroVisual, style } from '@tempoxyz/ds'
import { useState } from 'react'

const steps = ['connect', 'approve', 'fund', 'funding', 'funded'] as const

export function Demo() {
  const [index, setIndex] = useState(0)

  return (
    <div {...styles.frame()}>
      <HeroVisual step={steps[index]}>
        <HeroVisual.Caption>Claude</HeroVisual.Caption>
        <HeroVisual.Title>Your agent</HeroVisual.Title>
        <HeroVisual.Description>One command, and it can pay its own way.</HeroVisual.Description>
      </HeroVisual>
      <Button onClick={() => setIndex((index + 1) % steps.length)} variant="secondary">
        Next step
      </Button>
    </div>
  )
}

namespace styles {
  export const frame = style({
    display: 'grid',
    gap: '16',
    justifyItems: 'start',
    maxWidth: '31.25rem !custom',
    width: '100% !custom',
  })
}
```

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

## Anatomy

Import the component and assemble its parts.

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

<HeroVisual>
  <HeroVisual.Caption />
  <HeroVisual.Title />
  <HeroVisual.Description />
</HeroVisual>
```

## Guidelines

### When to Use

* Accompany the steps of an agent or wallet setup flow, beside the form of each step.

### When Not to Use

* Use [SuccessHero](/docs/components/success-hero) once the flow finishes.
* Use [GetStartedVisual](/docs/components/get-started-visual) for the cards of a get started list.

### Advance the Step With the Flow

* **Agent (connect to funded):** The agent flow runs connect, approve, fund, funding, and funded.
* **Wallet (wallet to secure):** The wallet flow runs wallet, wallet funding, wallet funded, and secure.

### Keep the Title Short

The title sets at display size and fits about 12 characters on one line.

**Do:** Name the subject of the flow in two words.

```tsx
<HeroVisual step="connect" style={{ minHeight: 240, width: 320 }}>
  <HeroVisual.Title>Your agent</HeroVisual.Title>
</HeroVisual>
```

**Don't:** Write a sentence in the title.

```tsx
<HeroVisual step="connect" style={{ minHeight: 240, width: 320 }}>
  <HeroVisual.Title>Set up your agent to pay for things</HeroVisual.Title>
</HeroVisual>
```

## Content

* **Caption:** Name the agent or wallet in one or two words.
* **Title:** Name the subject of the flow, such as Your agent.
* **Description:** Write one sentence that states what the flow enables.

## Accessibility

The card renders a `<div>` with no role. Screen readers skip the artwork and the wordmark, and read the text in order.

* **Artwork (aria-hidden):** The streaks and the wordmark are decorative.
* **HeroVisual.Title (h2):** Announced as a second-level heading.
* **Reduced Motion (prefers-reduced-motion):** New streaks fade in without movement.
* **Announce Progress (Your task):** The steps of the flow announce progress, not the card.

## Related

[SuccessHero](/docs/components/success-hero)

Use for the confirmation after the flow finishes.

[Stepper](/docs/components/stepper)

Use for the steps beside the card.
