Skip to content

Stateful Button

Click-triggered state machine button with idle → loading → success transitions. Zero-dependency animations using CSS transitions and keyframes.

Loading preview…

Installation

Run the following command

npx orunk add stateful-button

PropTypeDefaultDescription
loadingDurationnumber4000Duration of loading state in ms (auto mode only)
successDurationnumber2000Duration of success state in ms
onClick(done: () => void) => voidClick handler with done callback for async control
colorstring"rgb(34, 197, 94)"Background color (CSS color value)
childrenReact.ReactNodeButton label
classNamestringAdditional CSS classes