Magnetic Button Group

Motion Components · Vol. 1

Component

Magnetic Button Group

Steel tokens on a plate of iron filings. Your cursor is the magnet: the field bends toward it, the tokens lean in, and choosing one slams it into the socket while a ferrofluid puck rears up its spikes.

Move across the plate, click a token, or use the arrow keys.

Variants

Sizes and states, all built from the same markup.

Small
Default
Disabled

Usage

Paste the markup, include assets/css/tokens.css and assets/css/tailwind.css, then run the script from this page.

Accessibility