# Promise Toast

> One toast for one async job: a spinner and progress bar while it runs, then it settles in place. The spinner pops into a drawn check or cross with a ripple, the title cross-fades, the bar folds away and follow-up actions slide in. Errors shake once. Controlled, so it fits any promise, mutation or deploy.

- Slug: `promise-toast`
- Category: [Toasts](https://www.assembli.design/category/toasts.md)
- Type: component
- Tags: toast, promise, loading, progress, async, deploy
- npm dependencies: motion, lucide-react
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/promise-toast
- Page: https://www.assembli.design/components/promise-toast

![Promise Toast preview](https://www.assembli.design/thumbnails/promise-toast-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `status` (required) | `PromiseToastStatus` |  |  |
| `title` (required) | `React.ReactNode` |  |  |
| `description` | `React.ReactNode` |  |  |
| `progress` | `number` |  | 0–1 while loading. Leave it out for an indeterminate bar. |
| `meta` | `React.ReactNode` |  | Small text on the right, such as elapsed time ("12s") or a step count ("2 of 3"). |
| `actions` | `PromiseToastAction[]` |  | Shown once the promise settles, e.g. "Visit" on success or "Retry" on error. |
| `onDismiss` | `() => void` |  |  |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/promise-toast/promise-toast.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/promise-toast
```

Registry item JSON: https://www.assembli.design/r/promise-toast.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
