No.06 · Buttons
Tidefill
A pill that fills like a tide: liquid rises from the bottom with a rolling wave, revealing the ink-coloured label exactly where it reaches.
The prompt
The design brief behind this component — reuse it to regenerate, remix, or explain it.
Design a pill button (56px, overflow hidden, hairline cream border, near-black plum face, cream label) that fills with liquid on hover. The label is rendered twice: once in cream on the dark face, and once in dark ink inside a liquid layer. The liquid layer is the same size as the button, translated 101% down. On hover or focus it rises to 0 over 700ms (cubic-bezier(0.16,1,0.3,1)). The ink label sits inside the liquid but is counter-translated by −101% (and animates to 0 with the same timing), so it stays perfectly still in the button while the liquid — which clips it — sweeps over it; the result is that the letters change from cream to ink exactly along the liquid's surface. The liquid's top edge is an SVG wave path twice the button width, sliding left on a 2.6s linear loop so its surface rolls like water. Offer frost, lilac and cream fills. On touch, a low tide rests along the bottom edge with a shallower wave whose crest stays below the label, and floods on press. Reduced motion stops the wave and shortens transitions. 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: Hover/focus floods the button from the bottom; leaving drains it. Press scales to 98.5%. Motion: Fill 700ms ease-out-expo; wave loop 2.6s linear; border 300ms. Accessibility: A real <button> whose accessible name is the label text; the duplicated ink label is aria-hidden. Visible focus ring in the fill colour. Responsive behavior: Intrinsic width; 11rem minimum. Touch: A low tide rests along the bottom edge, clear of the label, and floods on press. 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
- Hover/focus floods the button from the bottom; leaving drains it. Press scales to 98.5%.
- Motion
- Fill 700ms ease-out-expo; wave loop 2.6s linear; border 300ms.
- Accessibility
- A real <button> whose accessible name is the label text; the duplicated ink label is aria-hidden. Visible focus ring in the fill colour.
- Responsive
- Intrinsic width; 11rem minimum.
- On touch
- A low tide rests along the bottom edge, clear of the label, and floods on press.