Component packs › Tangram › Success Button
While your action runs the icon scrambles through figures; on success it locks back into the square and a tick is cut across it.
Success Button is a button from Tangram, a component pack with 6 tangram controls: Seven tangram pieces that rearrange into every state of your interface. Price: $2 for the whole pack.
Built with: promise aware, figure cycle, tick on success.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | ||
pendingLabel | string | ||
doneLabel | string | ||
action | () => void | Promise<unknown> | Runs on press; return a promise to keep the pieces moving until it settles. | |
disabled | boolean | ||
theme | "light" | "dark" | ||
autoplay | number | false | Showcase mode: presses itself every N ms while visible. |
press(): voidsetDisabled(disabled: boolean): voiddestroy(): voidimport SuccessButton from './SuccessButton';
<SuccessButton />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: 404 and empty states.