Lifetime prices rise on 19 October →
Phox Elements
ANIMATION Cursor-following buttons for Breakdance

A button that pulls towards the cursor

Magnetic Button is a standard Breakdance button that leans towards the mouse as it gets close, then springs back when the mouse leaves. The label moves a little further than the button, which gives it a sense of depth. You set the pull, the easing and an optional glow.

Uses the Breakdance button styles GSAP powered motion Optional hover glow
Live demos

Move your mouse over each button

Four versions of the same element with different strength, easing, scale and glow settings. Bring the cursor close to a button and move it around.

Default

Snappy with glow

Strength 0.5, text movement 0.3, Snappy easing and a soft indigo glow.
Elastic

Springy and strong

Strength 0.8 with Elastic easing and a 1.1 hover scale, so it stretches towards the cursor.
Subtle

Quiet, no glow

Strength 0.3, Smooth easing and a small 1.02 scale. Glow is switched off.
On dark

Bright glow

A light button on a dark panel with Overshoot easing and a strong glow.
How it works

Three steps to a magnetic button

It is set up like any other Breakdance button, with a few extra motion settings.

1

Add the element

Drop Magnetic Button onto your page and type the button text and link, just like a normal button.

2

Style the button

Use the familiar Breakdance button design panel for colours, size, corners and typography.

3

Tune the motion

Set the magnetic strength, how far the label moves, the easing and the return time, then add a glow if you want one.

Features

What you can control

Everything is set in the Breakdance editor. No code needed.

Follows the cursor

The button moves towards the mouse while the cursor is over it or within about 50px of its edge.

Label moves separately

The text has its own movement setting, so it can travel further or less than the button for a layered look.

Adjustable strength

Set how strongly the button is pulled, from 0.1 for a slight lean to 1 for a strong pull.

Five easing styles

Choose Smooth, Snappy, Elastic, Overshoot or Exponential for how the button follows the cursor.

Springy return

When the mouse leaves, the button springs back to its place. You set how long the return takes.

Hover scale

Grow the button slightly on hover, from 1 (no scale) up to 1.5.

Optional glow

Add a blurred glow behind the button on hover with your own colour and strength.

Breakdance button styles

Uses the standard Breakdance button design options, including custom colours, size, corners and full width.

Dynamic text and link

The button text and URL accept dynamic data, so it works in templates and loops.

Use cases

Where it works best

Use it for the one or two buttons you most want people to click.

01

Hero calls to action

Give the main button on a landing page a little life so it stands out.

02

Pricing pages

Draw attention to the plan you want visitors to choose.

03

Portfolio sites

Add a playful touch to contact or project buttons on creative sites.

04

Event and ticket pages

Make the booking or ticket button the obvious next step.

05

Newsletter sign-ups

Encourage clicks on a subscribe button at the end of a post.

06

Product launches

Pair it with a bold headline for a launch or pre-order page.

Settings reference

Every control, explained

This is the full list of settings in the Breakdance editor, with their default values.

ControlWhat it doesDefault
Content
TextThe button label. Accepts dynamic data.Hover Me
LinkWhere the button goes. Accepts dynamic data.#
Magnetic Settings
Magnetic StrengthHow strongly the button is pulled towards the cursor (0.1 to 1).0.5
Text MovementHow far the label moves inside the button (0 to 0.5). 0 keeps the text still.0.3
Magnetic Radius (px)The distance over which the pull fades out (50 to 300).200
Animation EasingSmooth, Snappy, Elastic, Overshoot or Exponential.Snappy
Return Duration (s)How long the button takes to spring back when the mouse leaves (0.2 to 1.5).0.7
Design
ButtonThe standard Breakdance button design: style, colours, size, corners, typography and full width.Custom, #6366f1, large, round
Enable GlowShow a blurred glow behind the button on hover.On
Glow ColorColour of the glow.#6366f1
Glow IntensityOpacity of the glow on hover (0.1 to 1).0.5
Hover ScaleHow much the button grows on hover (1 to 1.5).1.05
SpacingTop and bottom margin.—
Tips & FAQ

Good to know

What does it need to run?

The motion uses the GSAP animation library, which the element loads for you from a CDN. You do not need to add anything else.

Does it work on phones?

The effect follows the mouse pointer, so it is a desktop effect. On touch screens the button still works as a normal link.

Can I use my existing button styles?

Yes. The design panel is the standard Breakdance button panel, so you can use the same colours, sizes, corners and typography as your other buttons.

How close does the cursor need to be?

The button reacts once the cursor is over it or within about 50px of its edge. The Magnetic Radius setting controls how quickly the pull fades with distance.

Can I turn off the glow?

Yes. Switch off Enable Glow in the Magnetic Effects section and the button keeps the movement without the glow.

Add Magnetic Button to your next page

Magnetic Button is included with Phox Elements, along with 150+ other premium elements for Breakdance.