Loading State Button
Stateful button cycling idle → loading → success → idle, with async onAction support.
Copy a prompt for your AI coding tool with the source, dependencies and usage
Props
LoadingStateButtonProps
Also accepts all props of Omit<React.ComponentProps<"button">, "children">
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | "Save changes" | — |
| loadingLabel | string | "Saving" | — |
| successLabel | string | "Saved" | — |
| duration | number | 1500 | Fake request time in ms. Ignored when onAction returns a promise. |
Install
$ npx shadcn@latest add https://chromotion.dev/r/loading-state-button.json