Skip to content

No.48 · 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

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

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 (lilac): tone="lilac": the fill is lilac (#c8b9ea) with plum-ink letters inside it, on #0b080d. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. 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 behavior: Intrinsic width with an 11rem minimum. Touch: Fills from the centre while pressed. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

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.