Components / component

Fill Slide Button

v1.0.0 · premium

An outline pill that fills from whichever edge the pointer enters and empties out through the edge it leaves.

Fill Slide Button demo

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

Download source ZIP
export function FillSlideButton({ children, href, onClick, type = 'button', size = 'md', disabled = false, ink, paper, c
  children: string;
  href?: string;

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.