FreeButtons
Moving Border
Use this component for primary actions, submit buttons, upgrade CTAs, and any button that needs subtle motion without becoming noisy.
ReactTailwind CSSMotionButton
Overview
A rounded button with an animated conic border that rotates around the container.
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<MovingBorder />Moving Border.tsx
tsx"use client";
import { motion } from "framer-motion";
export function MovingBorder() {
return (
<button className="relative overflow-hidden rounded-full p-px">
<motion.span
animate={{ rotate: 360 }}
transition={{ duration: 2, repeat: Infinity, ease: "linear" }}
className="absolute -inset-8 bg-[conic-gradient(from_90deg,transparent,rgba(125,211,252,.9),transparent_30%)]"
/>
<span className="relative block rounded-full bg-zinc-950 px-8 py-3 text-sm font-semibold text-white">
Submit Report
</span>
</button>
);
}