FreeButtons
Magnetic Glow Button
Use this for primary CTAs on landing pages, pricing cards, modal footers, and onboarding screens where a small motion cue can make the next action feel more deliberate.
ReactTailwind CSSMotionButton
Overview
A springy CTA button with hover lift, tap feedback, and a passing shine effect.
Framework
React
Styling
Tailwind CSS
Animation
Motion
Create a Vite React project
bashnpm create vite@latest my-ui-app -- --template react-ts
cd my-ui-app
npm installCreate a Next.js project
bashnpx create-next-app@latest my-ui-app --typescript --tailwind --eslint
cd my-ui-appAdd Tailwind CSS to Vite
bashnpm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -pInstall dependencies
bashnpm install framer-motionUsage
tsx<MagneticGlowButton />Magnetic Glow Button.tsx
tsx"use client";
import { motion } from "framer-motion";
export function MagneticGlowButton() {
return (
<motion.button
type="button"
whileHover={{ y: -3, scale: 1.04 }}
whileTap={{ scale: 0.98 }}
transition={{ type: "spring", stiffness: 420, damping: 24 }}
className="group relative overflow-hidden rounded-full border border-lime-300/30 bg-lime-300 px-6 py-3 text-sm font-bold text-zinc-950 shadow-2xl shadow-lime-300/20"
>
<span className="absolute inset-0 -translate-x-full bg-gradient-to-r from-transparent via-white/50 to-transparent transition-transform duration-700 group-hover:translate-x-full" />
<span className="relative">Start building</span>
</motion.button>
);
}