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.
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
| Prop | Type | Default | What it does |
|---|---|---|---|
| children | React.ReactNode | "Get Started Now" | Label. |
| href | string | "#" | Link target. |
| colors | string[] | ["#0a84ff", "#bf5af2", "#ff9f0a", "#30d158"] | Colours of the light on the rim and the glow behind. |
| background | string | — | Inner pill fill. Defaults to ink in light mode and near-white in dark mode. |
| textColor | string | — | Label colour. Defaults to ink or white, whichever reads better on the fill. |
| arrowColor | string | — | Arrow colour. Defaults to the label colour. |
| radius | number | 28 | Corner radius in px. |
| borderColor | string | — | Colour of the resting rim. |
| glow | string | — | Extra box-shadow under the button. |
| openInNewTab | boolean | false | Open the link in a new tab. |
| innerClassName | string | — | Extra classes for the inner pill (padding, font size). |
| autoplay | boolean | false | Orbits the light round the rim until someone points at the button. |
| MagneticButton.children | React.ReactNode | "Get started" with an arrow | Magnetic Button: the label. It leans further toward the pointer than the button itself. |
| MagneticButton.variant | "solid" | "outline" | "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.strength | number | 0.35 | Magnetic Button: how far the button leans toward the pointer, as a fraction of the distance from its centre. |
| MagneticButton.onClick | () => void | — | Magnetic Button: called when the button is pressed. |
| MagneticButton.aria-label | string | — | Magnetic Button: accessible name, when the label alone is not enough. |
| MagneticButton.autoplay | boolean | false | Magnetic Button: a ghost pointer leans in, floods ink, presses and drains out on a loop until someone touches the button. |
| MagneticButton.enableSound | boolean | true | Magnetic Button: plays a soft tap on press. Follows the site-wide sound switch. |
| MagneticButton.className | string | — | Magnetic Button: extra classes for the button. |
| enableSound | boolean | true | Plays 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
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 createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor 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.
- 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
- 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.tsxindex.tsmagnetic-button.tsx - 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:
- 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.