Commerce
v1.0.0Added in 1.0.0
The heart that saves a listing: fills with a spring pop and a burst, keeps a count, saves optimistically and rolls back on failure.
Tap or click the heart to save: it dips, pops past its size on a bouncy spring, fills in and throws a ring and a handful of particles; tap again and the fill shrinks away. With a count the number rolls up or down by one right away. While the save request is pending further taps are ignored; when it fails the heart shakes, goes back to how it was and the error is read out. On a phone a light tick answers the tap, every size has a 44px target, and the glass heart on a photo sits above the card's link so it never opens the listing. With a mouse the action shows as a tooltip. Tab to it and press Space or Enter to toggle; screen readers hear one constant name, the pressed state and the count.
npx wingo-ui@latest add favorite-buttonPro item: the CLI needs a Pro account. See plans
pressed false · count 0 · last none yet
tooltip on · haptics on · burst 8 particles · locale auto (en-US)
Tap the heart to save; tap anywhere else on the card to open the listing