Button - Neon

A dynamic and customizable button with an animated glowing border using GSAP + Framer Motion.

The ButtonNeon is a sleek animated button with a glowing border that can be customized for color, intensity, and animation speed.
It uses GSAP for glowing animation and Framer Motion for hover/tap effects.

Live Preview
Open in
Gsap

Props

PropTypeDefaultDescription
childrenReact.ReactNodeundefinedThe content inside the button (text, icon, etc.).
classNamestring""Custom Tailwind CSS classes for styling the button.
onClick(e: React.MouseEvent<HTMLButtonElement>) => voidundefinedCallback when the button is clicked.
glowColorstring"#ffffff"Glow color (default is white).
glowIntensitynumber20Intensity of the glow (higher = stronger glow).
durationnumber1.5Duration (in seconds) for glow animation cycle.
repeatnumber-1Number of times animation repeats (-1 = infinite).
yoyobooleantrueWhether the glow reverses back after animation.
type"button" | "submit" | "reset""button"Button type.
disabledbooleanfalseDisables the button when set to true.

Default (White Glow)

<NeonBorderButton onClick={() => alert("Clicked!")}>
  White Glow
</NeonBorderButton>

Custom Glow Color

<NeonBorderButton glowColor="#00ffcc" glowIntensity={30}>
  Cyan Glow
</NeonBorderButton>

Fast Animation

<NeonBorderButton glowColor="#ff00ff" duration={0.8}>
  Fast Purple Glow
</NeonBorderButton>

Disabled Button

<NeonBorderButton disabled>
  Disabled Glow
</NeonBorderButton>

Full Width with Tailwind Override

<NeonBorderButton className="w-full text-lg font-bold">
  Full Width Glow
</NeonBorderButton>