# Shadcn Updatable

> Updatable toast with ID

- Type: example, free and open source (MIT)
- Component: [Sonner](https://reui.io/components/sonner.md)
- Page: https://reui.io/components/sonner/c-sonner-21
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/toast.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/sonner.md
- MCP: `get_example("c-sonner-21")`
- Registry item: https://reui.io/r/styles/base-nova/c-sonner-21.json
- Uses: Button, Spinner

## Best for

A spinner line rewritten through a stored toast id from preparing to 30 and 70 percent, then a success card

## Agent notes

- The 3 `setTimeout` steps fake the upload; call `toast.custom` with `toastId` from your real progress callbacks
- Loading steps pass `Infinity` as `duration`, so an upload that fails must update or dismiss `toastId` or the spinner never closes

## When not to use

- A determinate bar that fills as bytes arrive: use [Upload Progress](https://reui.io/components/sonner/c-sonner-10.md) (`get_example("c-sonner-10")`)

## Third-party libraries

- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/c-sonner-21
```

## About Shadcn Sonner

### When to use

- Brief feedback after an action, such as a created event or an archived message with Undo
- Progress of async work in one toast that updates in place, from loading to success or failure
- Rich notifications for messages, invites, deploys, builds and integrations, with their own buttons

### When not to use

- A status or warning that must stay on the page until the problem is fixed: use [Alert](https://reui.io/components/alert.md) (`get_component("alert")`)
- A choice the user has to make before the page can carry on: use [Alert Dialog](https://reui.io/components/alert-dialog.md) (`get_component("alert-dialog")`)
- An inbox panel that lists past activity for the user to review on demand: use the [Sheet blocks](https://reui.io/blocks/application/sheet.md)

### Agent notes

- The examples ship only the sonner package and never render `Toaster`; mount the shadcn sonner `Toaster` once near your app root or no `toast` shows

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
