Action Button
A collection of stateful interactive action, commerce, and confirmation buttons powered by motion/react — featuring spring-morphing icons, odometer digit rolling, hold-to-confirm progress, draggable slide-to-confirm, inline waitlist expansion, cart parcel drop physics, split action menus, and payment/download progress states.
Interactive Action, Async & Commerce Buttons
- Async Button
AsyncButtonaction() - delays spinner by
loadingDelay(200ms) and morphs to checkmark on resolve. - Hold to Confirm
HoldToConfirmholdDuration - lifts trash lid
-34degand fills background over hold duration; showsKeep holdingon early tap. - Star & Upvote
StarButtonicon="star" | "upvote" - toggles pressed state with spring icon twirl and carry-animated odometer digits.
- Follow Button
FollowButtononFollowingChange - morphs SVG strokes (plus → check → cross) and reveals red
Unfollowonly after pointer leaves and re-enters. - Split Button
SplitButtonoptions, onAction - primary action button paired with an animated dropdown menu for switching modes.
- Add to Cart
AddToCartprice, max - drops a parcel into the dipping basket and morphs into a rolling quantity stepper.
- Interactive Download
InteractiveButtonaction(progress) - sweeps horizontal progress fill with live percentage or indeterminate creep.
- Slide to Confirm
SlideToConfirmthreshold, resetAfter - draggable slider thumb with ink clip-path reveal, tap nudge, and
Deploying→Deployedfeedback. - Payment Button
PaymentButtonamount, action - transitions through idle → processing → paid (or shakes on failed).
- Waitlist Button
WaitlistButtonaction(email) - expands smoothly into an inline email form and rolls queue position with an odometer.
Installation
New project? Follow the installation guide to set up Tailwind CSS, shadcn, the cn helper and lucide-react, register the @avara-ui registry once, then copy your styles from the Themes page.
Install Action Buttons
components/ is written into your project. Copy any snippet from a Usage tab above and it runs.
Install dependencies
Step 1 installs this for you. Run it yourself only if you are adding Action Buttons to an existing project by hand. The cn helper and lucide-react are not listed — the installation guide covers them once for every component.
motion is an npm package.
Components Included
AsyncButton: Fixed-width async action trigger with delayed spinner (loadingDelay) and blur/slide checkmark confirmation.HoldToConfirm: Destructive press-and-hold button with hinged trash lid rotation (-34deg), linear fill, early-tap"Keep holding"hint, and haptic vibration.StarButton(star&upvote): Split counter button with spring icon twirl, gold star fill / upvote triangle fill, and carry-animatedOdometerdigits.FollowButton: Morphing SVG strokes (plus→check→cross) with pointer-leave arming before revealing the soft-redUnfollowhover state.SplitButton: Primary action button paired with an animated dropdown menu, keyboard navigation (ArrowUp/ArrowDown/Home/End/Escape), and async running/done icon states.AddToCart: Drops a5×5pxparcel into the dipping cart basket and transitions into a rolling−/+quantity stepper withmaxstock clamping.InteractiveButton: Horizontal progress sweep with live0%–100%readout (or indeterminate creep) andDownloadedcompletion feedback.SlideToConfirm: Accessiblerole="slider"track with clipped ink sweep, non-overshoot spring return, tap nudge, and keyboard shortcuts.PaymentButton: Lock-badged checkout trigger transitioning throughidle→processing→paid(or horizontal shake on failure).WaitlistButton: Morphs smoothly viaclipPathand SVG outline into an inline email form and rolls queue position via an odometer.