Overlays
v1.0.0Added in 1.0.0
A short modal question that must be answered, with an async confirm that loads, fails inline and shakes, plus an await confirm() API.
Press the trigger and the page dims while the card rises into the center on a smooth spring, its icon popping in a beat later. Focus lands on Cancel, the safe choice; Tab moves between the two buttons, Enter presses the focused one and Escape cancels. Clicking the dimmed page does nothing, because the question has to be answered. When the confirm returns a promise the action shows a spinner, Cancel and Escape wait, and the dialog closes once the request succeeds; if it fails the card shakes, the error slides in above the buttons and the action is ready to retry. In a type-to-confirm field Enter confirms as soon as the action is enabled. When it closes, focus goes back to the trigger, or to whatever had it before a confirm() call or a trigger-less open. On a phone it stays a centered card with the buttons stacked full width, the action on top and 44px tall. With reduced motion it only fades.
npx wingo-ui@latest add alert-dialogPro item: the CLI needs a Pro account. See plans
Linus city bike
Brooklyn · 12 messages
Confirm waits 1.4s while the button reads “Deleting”. A failed request shakes the card and shows its error.