Skip to content
uicoolkit
  • Components

  • Docs

↑↓ navigate↵ open/ anywhere
Menu

Stateful Button

FreeNewSample

Idle, loading, success and error in one control. Width animates between labels so layouts never jump, and screen readers hear every outcome.

Original
  • buttons
  • feedback
  • forms

Customize

Accent
Motion
Speed

These controls show a few ways to adapt it. The source is fully editable.

Install

Not published yet
npx shadcn@latest add @uicoolkit/stateful-button

Install commands go live when this item ships to the registry.

Dependencies

  • motion

Use with an agent

Copy a prompt with this component, your current preview settings and links to its docs.

Add the UICoolKit "Stateful Button" component (stateful-button) to this project.
Docs: https://uicoolkit.com/components/stateful-button
Agent docs: https://uicoolkit.com/components/stateful-button.md
Install: npx shadcn@latest add @uicoolkit/stateful-button
Preview settings to match: accent Ember, radius 12px, motion on.
Use the documented props and className hooks rather than editing internals, and wire it to this app's real state.
(Note: this is a sample item from the UICoolKit website shell and is not published yet.)
stateful-button.tsx
<StatefulButton
  action={saveChanges}
  labels={{ idle: "Save changes", success: "Saved" }}
/>