Rainbow Gradient Pill
21st.dev Magic UI rainbow-button: indigo→violet→fuchsia gradient border pill, spring hover lift + glow. TetraKits “Browse UI Library” with component count badge.
Dependencies
react
framer-motion
npm install framer-motion"use client";
import { motion } from "framer-motion";
function cn(...inputs: (string | undefined | null | false)[]) {
return inputs.filter(Boolean).join(" ");
}
export function RainbowPillButton({ children = "Browse UI Library" }: { children?: React.ReactNode }) {
return (
<motion.button
whileHover={{ scale: 1.05, y: -3 }}
whileTap={{ scale: 0.96 }}
transition={{ type: "spring", stiffness: 420, damping: 22 }}
className={cn(
"group relative inline-flex overflow-hidden rounded-full p-[2px]",
"bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500",
"shadow-lg shadow-violet-500/30 hover:shadow-xl hover:shadow-violet-500/45"
)}
>
<span className="absolute inset-0 bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500 opacity-80 blur-md transition-opacity group-hover:opacity-100" />
<span className="relative flex items-center gap-2 rounded-full bg-zinc-950 px-6 py-2.5 text-sm font-semibold text-white">
{children}
<span className="text-xs font-normal text-violet-300/80">67+</span>
</span>
</motion.button>
);
}
Please implement this code in the current project and add it to (Your Desired Section, e.g. homepage hero, pricing page, dashboard). Change the primary accent color to (YOUR HEX CODE COLOR, e.g. #6366F1).
Requirements:
- Use React + Tailwind CSS (match the project's existing setup)
- Install dependencies if needed: npm install framer-motion
- Keep the layout responsive on mobile and desktop
- Replace placeholder copy with content that fits the project
The UI code:
"use client";
import { motion } from "framer-motion";
function cn(...inputs: (string | undefined | null | false)[]) {
return inputs.filter(Boolean).join(" ");
}
export function RainbowPillButton({ children = "Browse UI Library" }: { children?: React.ReactNode }) {
return (
<motion.button
whileHover={{ scale: 1.05, y: -3 }}
whileTap={{ scale: 0.96 }}
transition={{ type: "spring", stiffness: 420, damping: 22 }}
className={cn(
"group relative inline-flex overflow-hidden rounded-full p-[2px]",
"bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500",
"shadow-lg shadow-violet-500/30 hover:shadow-xl hover:shadow-violet-500/45"
)}
>
<span className="absolute inset-0 bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500 opacity-80 blur-md transition-opacity group-hover:opacity-100" />
<span className="relative flex items-center gap-2 rounded-full bg-zinc-950 px-6 py-2.5 text-sm font-semibold text-white">
{children}
<span className="text-xs font-normal text-violet-300/80">67+</span>
</span>
</motion.button>
);
}
Replace (Your Desired Section) and (YOUR HEX CODE COLOR) before pasting into Cursor, Copilot, or ChatGPT.