Avara UI

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 ButtonAsyncButtonaction()
delays spinner by loadingDelay (200ms) and morphs to checkmark on resolve.
Hold to ConfirmHoldToConfirmholdDuration
lifts trash lid -34deg and fills background over hold duration; shows Keep holding on early tap.
Star & UpvoteStarButtonicon="star" | "upvote"
toggles pressed state with spring icon twirl and carry-animated odometer digits.
Follow ButtonFollowButtononFollowingChange
morphs SVG strokes (plus → check → cross) and reveals red Unfollow only after pointer leaves and re-enters.
Split ButtonSplitButtonoptions, onAction
primary action button paired with an animated dropdown menu for switching modes.
Add to CartAddToCartprice, max
drops a parcel into the dipping basket and morphs into a rolling quantity stepper.
Interactive DownloadInteractiveButtonaction(progress)
sweeps horizontal progress fill with live percentage or indeterminate creep.
Slide to ConfirmSlideToConfirmthreshold, resetAfter
draggable slider thumb with ink clip-path reveal, tap nudge, and Deploying → Deployed feedback.
Payment ButtonPaymentButtonamount, action
transitions through idle → processing → paid (or shakes on failed).
Waitlist ButtonWaitlistButtonaction(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

npx shadcn@latest add https://avaraui.com/r/action-buttons.json

components/custom/blocks/ActionButtons.tsx 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.

npm install motion

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-animated Odometer digits.
  • FollowButton: Morphing SVG strokes (plus → check → cross) with pointer-leave arming before revealing the soft-red Unfollow hover 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 a 5×5px parcel into the dipping cart basket and transitions into a rolling − / + quantity stepper with max stock clamping.
  • InteractiveButton: Horizontal progress sweep with live 0%–100% readout (or indeterminate creep) and Downloaded completion feedback.
  • SlideToConfirm: Accessible role="slider" track with clipped ink sweep, non-overshoot spring return, tap nudge, and keyboard shortcuts.
  • PaymentButton: Lock-badged checkout trigger transitioning through idle → processing → paid (or horizontal shake on failure).
  • WaitlistButton: Morphs smoothly via clipPath and SVG outline into an inline email form and rolls queue position via an odometer.