A submit button that handles its own async state: return a Promise from onClick and it goes loading, then success with a drawn check or error with a retry label, and resets after a delay. Shrink style collapses into a round spinner, inline style keeps the width. Also accepts a controlled state, announces each state politely and ignores presses while busy.
pnpm dlx shadcn@latest add "https://sunui.synvize.com/r/loading-button.json"