design-infraGitHub
Report a problem or share feedback← Catalog

Magnetic Fill Button

curatedfree

microkit/magnetic-fill-button

A magnetic pill button with a bottom-to-top background fill.

hover · cursor — subtlerecipePlayfulRefined
$npx shadcn@latest add https://microkit.co/r/magnetic-fill-button.json

Our notes

Zero-dependency magnetic button: pointermove writes CSS vars (14%/22% of the cursor offset) that translate the pill, and a fill rises bottom-to-top on hover/focus (380ms). Much lighter than Motion-based magnets. No reduced-motion guard on the translate; the outline, text and #f97316 fill are hard-coded — use border-foreground and a bg-primary fill with text-primary-foreground.
Source
MicroKit
Kind
component
Categories
button
Use as
recipe — technique you apply to your own markup
Applies to
buttoncta
Motion
on hover, cursor · subtle · css + js · low cost · ignores reduced motion
Tags
css, hover, magnetic, hard-coded-colours
Licence
MIT ("MIT License — Copyright (c) 2026 Henrique Barone", github.com/henriquegpb/microkit). README credits note that some interactions are adapted from publicly shared examples and Webflow exports.
Live demo
microkit.co
Docs
microkit.co