Free
π¬ Landing Page
Button Motion Set
A cohesive set of 6 animated buttons: magnetic, shine-sweep, morph-to-loader, icon-nudge, gradient-ring, ghost-fill.
3.5k views 371 copies 296 words
The Prompt
# Button Motion Set β UI Component Set ## Goal Build six production-grade animated button variants sharing one base API, presented in a small demo grid. It must drop cleanly into an existing Next.js + Tailwind project as a self-contained component. ## Design Spec - Shared base: h-11 px-6 rounded-lg font-medium text-sm, focus-visible ring, disabled 50% + no animations; sizes sm/md/lg via prop. - 1 **Magnetic** β button translates up to 6px toward cursor within a 40px proximity field, springs back on leave. - 2 **Shine sweep** β a 60% width diagonal white/20 gradient sweeps across on hover (500ms), only once per enter. - 3 **Morph loader** β on click, width animates to square, label fades, spinner appears; then morphs to β state; controlled via `status` prop (idle/loading/success). - 4 **Icon nudge** β arrow icon translates 4px right + slight rotate on hover; text and icon gap compresses 1px β feels eager. - 5 **Gradient ring** β 1px conic-gradient ring rotates continuously behind transparent border; hover speeds rotation 2Γ. - 6 **Ghost fill** β outline button where a background fill grows from the cursor's entry point (measure enter coordinates, scale a circle from there). ## Motion Spec - All transforms spring-based (stiffness 300, damping 20) except shine (tween). - Press state universal: scale 0.97, 80ms. - Reduced motion: variants degrade to simple opacity/color hovers β buttons must remain obviously interactive. - Respect `prefers-reduced-motion` β provide a static fallback that still looks intentional. ## Component API - `<MotionButton variant='magnetic'|'shine'|'morph'|'nudge'|'ring'|'ghost-fill' size status? asChild? />` ## Quality Bar - TypeScript strict, zero `any`. Tailwind only β no external CSS files. - Works on mobile: touch targets β₯ 44px, no hover-only affordances. - 60fps: animate only `transform` and `opacity`; use `will-change` sparingly. - Accessible: correct roles/aria, keyboard operable, focus-visible styles.
You may also like
Free
Featured
Aurora Hero Section
π¬ Landing Page
Full-viewport hero with aurora gradient backdrop and split-text headline reveal.
5.1k 441Cursorv0Lovable
Free
FAQ Accordion Pro
π¬ Landing Page
Two-column FAQ section with buttery height animation, deep-link anchors and a 'still stuck' contact card.
4.4k 54CursorClaude CodeLovable
Free
Conversion CTA Banner
π¬ Landing Page
Pre-footer CTA banner with animated gradient border, urgency-free copy structure and dual action hierarchy.
4.3k 827CursorClaude CodeLovable
Free
Glass Command Navbar
βοΈ SaaS
Glassmorphism navbar with scroll shrink, active-link lamp indicator and a built-in βK command palette stub.
2.3k 147CursorClaude CodeLovable