Components / component
Fill Slide Button
An outline pill that fills from whichever edge the pointer enters and empties out through the edge it leaves.

Implementation
An outline pill that fills from whichever edge the pointer enters and empties out through the edge it leaves.
- Framework
- React 19.3.1 with TypeScript
- Motion
- Native CSS and browser APIs. No GSAP required.
- Available modes
- build
- Version
- 1.0.0 · published
Source code
Quality evidence
Export tested in 2 consumer projects with chromium, firefox, webkit. Evidence recorded on .
Changelog
v1.0.0 · An outline pill that fills from whichever edge the pointer enters and empties out through the edge it leaves.
Frequently asked questions
How does it know which edge to use?
On pointer enter and leave it measures which edge of the button is nearest the pointer. Touch and keyboard use the bottom edge.
Why is the label drawn twice?
One copy sits on the page and one sits inside the fill. They move in opposite directions, so the text stays still while the fill sweeps across it. The second copy is hidden from assistive technology.