Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Glow Button, animated React component

A call-to-action link with a coloured light that lives on its rim. The brightest arc turns to face the pointer and the glow behind the button leans the same way, the button drifts a few pixels toward the cursor and the arrow springs ahead on hover. Also includes Magnetic Button: Leans toward your pointer with the label leaning further, ink floods in from where you enter and drains toward where you leave, and it squashes on press.

  • Free
  • CTA Sections
  • Hover
  • Glow
  • Spring

The Magnetic Button variant taps softly when you press it. Sound is off on this site until you switch it on.

Glow Button

Magnetic Button

Like Glow Button? 256 more are in Pro.

Pro unlocks all 256 Pro components, every template and block, and everything we release next. Glow Button stays free.

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

Props

PropTypeDefaultWhat it does
children"Get Started Now"Label.
href"#"Link target.
colors["#0a84ff", "#bf5af2", "#ff9f0a", "#30d158"]Colours of the light on the rim and the glow behind.
background—Inner pill fill. Defaults to ink in light mode and near-white in dark mode.
textColor—Label colour. Defaults to ink or white, whichever reads better on the fill.
arrowColor—Arrow colour. Defaults to the label colour.
radius28Corner radius in px.
borderColor—Colour of the resting rim.
glow—Extra box-shadow under the button.
openInNewTabfalseOpen the link in a new tab.
innerClassName—Extra classes for the inner pill (padding, font size).
autoplayfalseOrbits the light round the rim until someone points at the button.
MagneticButton.children"Get started" with an arrowMagnetic Button: the label. It leans further toward the pointer than the button itself.
MagneticButton.variant"solid"Magnetic Button: a solid ink pill that floods blue, or a white outlined pill that floods ink. Both have a dark mode twin.
MagneticButton.strength0.35Magnetic Button: how far the button leans toward the pointer, as a fraction of the distance from its centre.
MagneticButton.onClick—Magnetic Button: called when the button is pressed.
MagneticButton.aria-label—Magnetic Button: accessible name, when the label alone is not enough.
MagneticButton.autoplayfalseMagnetic Button: a ghost pointer leans in, floods ink, presses and drains out on a loop until someone touches the button.
MagneticButton.enableSoundtrueMagnetic Button: plays a soft tap on press. Follows the site-wide sound switch.
MagneticButton.className—Magnetic Button: extra classes for the button.
enableSoundtruePlays interface sounds on interaction. They follow the sound switch (setSoundsEnabled, on by default) and stay silent on hover. Autoplay makes the same sounds once the visitor has used the page. Pass false to silence this component.

Add it to your project

  1. 1

    Set up your project once

    You need a Next.js project with Tailwind CSS and the @/ import alias. In its root folder, run this once. It creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 2

    Connect the registry

    Run this once per project. It writes the Nexus UI entry into components.json for you:

    npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"

    Type it exactly as shown. {name} is filled in by the CLI with the component you ask for, so you never replace it.

  1. 3

    Add the component

    Run this from your project root. It adds the component, the helpers it imports and its npm packages.

    npx shadcn@latest add @nexus-labs/glow-button
  2. 4

    Check what was added

    With a project made as in the Quick Start (a src/ folder), these files land in it:

    components/
    glow-button/
    glow-button.tsx
    index.ts
    magnetic-button.tsx
  3. 5

    Copying by hand? Skip the registry

    Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that cn() exists. Install the packages:

    npm install framer-motion

    Then show the source and create each file at the path it gives:

  4. 6

    Use it in a page

    Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:

    // src/app/page.tsx
    import { GlowButton } from "@/components/glow-button";
    
    export default function Page() {
      return (
        <main>
          <GlowButton />
        </main>
      );
    }

Like Glow Button? 256 more are in Pro.

Pro unlocks all 256 Pro components, every template and block, and everything we release next. Glow Button stays free.

About Glow Button

The Glow Button is a primary CTA button with a cursor-reactive glow that repositions as the mouse moves across the button surface. The glow gradient updates through a React state update, with spring physics from Framer Motion smoothing the movement for a fluid feel. The button style is configurable for size, color, and border radius. A direct drop-in upgrade to any standard Tailwind button for primary call-to-action elements that need to stand out.

Good for

  • Primary CTA buttons on hero sections
  • Pricing plan purchase buttons
  • Form submit and action buttons
  • Download and install buttons

Glow Button questions

Does it make sound, and how do I turn it off?

The Magnetic Button variant taps softly when you press it. Sounds are synthesised with the Web Audio API, so there are no audio files, and they only play after a click or key press. Pass `enableSound={false}` to silence this component, or call `setSoundsEnabled(false)` from `@/lib/ui-sounds` to switch every sound off at once. The CLI installs `@/lib/ui-sounds` with the component.

Guides