# Next Action Banner

The one next step on an opportunity, at the top of its workspace: a toned icon tile, a title with a muted line, and the button that does it. Replaces UpNextCard and the conflict check flag.

- Beta: ready to use; its API can still change in a minor release.
- Category: Patterns · Workspace & pipeline

```tsx
import { NextActionBanner } from "@leap-crm/design-system";
```

## Best practices

- Do: Show one, at the top of an opportunity's workspace, for the single next step, like "Conflict check required".
- Do: Pick `tone` for the state: `yellow` to do, `warning` to review, `destructive` blocked, `success` clear and `teal` ready for the next step. The title says the state too, so colour is never the only signal.
- Do: Use a small Outline `Button` for `action`, or Primary when it is the step that moves the opportunity on, like generating the costs agreement.
- Do: Write `title` as what to do or where things stand, and keep `detail` to one muted line.
- Don't: Stack banners for several steps. Show the one that comes next; the rest belong in the opportunity's tasks.
- Don't: Use it for a system message, like LEAP being unreachable. Use `Alert`.

## Related

- [Alert](./alert.md)
- [Guide Card](./guide-card.md)
- [Pipeline](./pipeline.md)

## Examples

What the examples import:

```tsx
import { FilePen, ScanSearch, Shield, ShieldAlert, ShieldCheck, ShieldX } from "lucide-react";
import { Button, NextActionBanner } from "@leap-crm/design-system";
```

Scaffolding the examples call. It lives in the docs page, not in the library:

```tsx
const check = (
  <Button intent="outline" size="sm" icon={<ScanSearch />}>
    Perform Conflict Check
  </Button>
);

const states = [
  {
    icon: <Shield />,
    tone: "yellow",
    title: "Conflict check required",
    detail: "Check the parties before you send the costs agreement.",
    action: check,
  },
  {
    icon: <ShieldAlert />,
    tone: "warning",
    title: "Potential conflict",
    detail: "Possible matches need a review before you continue.",
    action: check,
  },
  {
    icon: <ShieldX />,
    tone: "destructive",
    title: "Conflict detected",
    detail: "A match was confirmed. Resolve it before you act for this client.",
    action: check,
  },
  {
    icon: <ShieldCheck />,
    tone: "success",
    title: "No conflicts found",
    detail: "Checked against every party on this opportunity.",
    action: check,
  },
  {
    icon: <FilePen />,
    tone: "teal",
    title: "Generate the costs agreement",
    detail: "The conflict check passed. Send the agreement next.",
    action: (
      <Button size="sm" icon={<FilePen />}>
        Generate agreement
      </Button>
    ),
  },
] as const;
```

### States

Yellow to do, orange to review, red blocked, green clear, teal ready for the next step. A white card with a border and no shadow; the action is a small Outline button, or Primary for the step that moves the matter on.

```tsx
<div className="flex max-w-160 flex-col gap-4">
  {states.map(state => (
    <NextActionBanner key={state.title} {...state} />
  ))}
</div>
```

### Title only

The detail line is optional.

```tsx
<div className="max-w-160">
  <NextActionBanner
    icon={<Shield />}
    tone="yellow"
    title="Conflict check required"
    action={check}
  />
</div>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `icon` (required) | `ReactNode` |  | The 16 px icon in the 32 px tile. |
| `tone` (required) | `Exclude<Tone, "default" \| "plum"> \| "neutral"` |  | The tile's tone, the state at a glance: yellow to do, warning to review, destructive blocked, success clear, teal ready for the next step. |
| `title` (required) | `ReactNode` |  | What to do next, or where things stand: "Conflict check required". |
| `detail` | `ReactNode` |  | One muted line under the title. |
| `action` | `ReactNode` |  | The button that does it, small: Outline, or Primary when it's the step that moves the matter on. |
| `className` | `string` |  | Classes added to the root element, merged with its own. Tokens only. |
