Transaction Button State Morph

A transaction action that morphs its icon and label across confirm, pending, success, and failed states.

The toggle group selects the transaction state and the primary button previews the resulting label, icon, disabled state, and destructive tone.

The action starts in confirm, moves to processing for four seconds on click, then randomly settles on success or failed. The secondary icon button resets the flow to confirm.

Implementation

Switch between shadcn, Tailwind, React CSS, and standalone HTML implementations.