Skip to content

No.44 · Buttons

Entry Point

A pill whose colour blooms from the exact point your cursor crossed its edge, and drains away toward the point where it leaves — the label inverts precisely along the circle.

The prompt

Written for the variant you picked above: Lilac

Design a pill button (56px, near-black plum face, cream label, hairline ring) in the same family as a liquid fill, but where the fill knows where you came from. On mouseenter, record the pointer's position as percentages of the button and write them to --ex/--ey; a full-size fill layer in the tone colour is clipped with clip-path: circle(0% at var(--ex) var(--ey)) and opens to circle(140%) over 640ms on cubic-bezier(0.16,1,0.3,1). On mouseleave, update the point to where the pointer exits and close the circle there on an ease-in curve (520ms), so the colour drains toward the side you left through. The label is rendered twice: on the face in cream, and inside the fill in ink, in an identical box — so the letters invert exactly along the edge of the circle as it passes over them. Keyboard focus blooms from the centre. On touch, the fill blooms from the centre while pressed. The ring takes the fill colour on hover. Selected variant — Lilac: tone="lilac": the fill is lilac (#c8b9ea) with plum-ink letters inside it, on #0b080d.

Notes

Interaction
Enter from any side and the colour blooms from that point; leave and it drains toward the exit point. Focus blooms from the centre.
Motion
clip-path circle 640ms expo-out in, 520ms ease-in out; ring colour 300ms.
Accessibility
A real <button>; the duplicated label inside the fill is aria-hidden. Focus-visible shows the filled state plus an outline. Reduced motion makes it instant.
Responsive
Intrinsic width with an 11rem minimum.
On touch
Fills from the centre while pressed.

Featured

301 components