Creative · Elementor

Magnetic Buttons widget for Elementor

Buttons that ease toward the cursor on hover. Use on a few CTAs, not every link.

Open live demo

Get King Addons

This page describes the PHP/JS for this widget — not a renamed stub. Install the free plugin from WordPress.org.

Get King Addons

What it actually does

Buttons that ease toward the cursor on hover. Use on a few CTAs, not every link.

Magnetic Buttons Widget (Free).

render() writes HTML data attributes: data-options, data-target.

The widget script reads data attributes: data-magnetic-init.

How to add it in Elementor

  1. Install King Addons. Install Elementor and King Addons. Get King Addons from WordPress.org.
  2. Edit with Elementor. Open a page and click Edit with Elementor.
  3. Insert the widget. Search the panel for “Magnetic Buttons”. Typing “king” lists every King Addons widget.
  4. Set inspector controls from this widget’s PHP. Configure “Button Text”, “Aria Label”, “Button Link”, “Alignment”. Style and Content tabs are listed on this page.

When to use it

Tip: After King Addons is active, type king in the Elementor search box to list every widget, including Magnetic Buttons.

Inspector controls from this widget’s PHP

ControlWhat the code does
Content — Button TextSaved on the widget and consumed in render().
Content — Aria LabelUsed when the button text is empty.
Content — Button LinkElementor URL control (href, new tab, nofollow) applied to a front-end link.
Content — AlignmentWrites CSS `text-align` onto the widget’s front-end markup. Options: Left; Center; Right.
Content — SizeThe chosen value is read in render() and applied on the front end. Options: Small; Medium; Large.
Content — Enable IconSwitcher inspector control (`kng_button_icon_enable`).
Content — IconIcon rendered with Elementor Icons_Manager in this widget’s HTML.
Content — Icon PositionThe chosen value is read in render() and applied on the front end. Options: Left; Right.
Content — Icon SpacingSpacing/size control (min 0, max 40).
Magnetic — Enable MagnetSwitcher inspector control (`kng_magnet_enable`).
Magnetic — StrengthSpacing/size control (min 0, max 100).
Magnetic — RadiusSpacing/size control (min 20, max 400).
Magnetic — Max OffsetSpacing/size control (min 0, max 60).
Magnetic — Return SpeedSpacing/size control (min 0, max 100).
Magnetic — EasingThe chosen value is read in render() and applied on the front end. Options: Smooth; Snappy; Calm.
Button — TypographyElementor typography group: family, size, weight, transform, style, decoration, line-height, letter-spacing. Selector: `{{WRAPPER}} .king-addons-magnetic-buttons__button`.
Button — PaddingWrites CSS `padding` onto the widget’s front-end markup.
Button — Border RadiusWrites CSS `border-radius` onto the widget’s front-end markup. (min 0, max 80).
Button — Border WidthSpacing/size control (min 0, max 8).
Button — Border StyleOptions: None; Solid; Dashed; Dotted; Double.
Button (Normal) — Background ColorColor written to this widget’s CSS selector.
Button (Normal) — Text ColorColor written to this widget’s CSS selector.
Button (Normal) — Border ColorColor written to this widget’s CSS selector.
Button (Normal) — Box ShadowElementor box-shadow group for the selector. Selector: `{{WRAPPER}} .king-addons-magnetic-buttons__button`.
Button (Hover) — Background ColorColor written to this widget’s CSS selector.
Button (Hover) — Text ColorColor written to this widget’s CSS selector.
Button (Hover) — Border ColorColor written to this widget’s CSS selector.
Button (Hover) — Box ShadowElementor box-shadow group for the selector. Selector: `{{WRAPPER}} .king-addons-magnetic-buttons__button:hover`.
Button — Transition Duration (ms)Numeric control (default 220, min 0).

Content and Style tabs from this widget’s PHP, including repeater fields and group controls (typography, background, border, shadow). Elementor’s Advanced tab is core Elementor and is not listed here.

FAQ

What does Magnetic Buttons actually change on the page?

Buttons that ease toward the cursor on hover. Use on a few CTAs, not every link. Inspector labels from this widget’s PHP include “Button Text”, “Aria Label”, “Button Link”, “Alignment”.

How do I add Magnetic Buttons in Elementor?

Install King Addons and Elementor, edit a page, search the panel for “Magnetic Buttons”, drag it onto the canvas, then set Content and Style.

Do I need Elementor Pro?

No. King Addons runs on free Elementor. Some King Addons options (for example template-in-accordion, extra popup conditions, parts of the template catalog) need King Addons Pro — not Elementor Pro.

Related creative widgets

Get King Addons

One free plugin. 80+ Elementor widgets, 650+ templates, and 4,000+ sections. Search for Magnetic Buttons after you activate it.

Get King Addons