Skip to content

No.25 · Buttons

Ripple Rim Button

A nudge you can see go out: pressing sends a wave from the spot you touched running both ways round the button's rim, fading as it travels.

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: Night

Build a 'Nudge Hamza' button whose outline is an SVG path of a pill, sampled every ~3px from the measured size, with an outward normal at each sample. At rest it's a face with a 1.5px frost rim. On press, find the rim sample nearest the pointer (from the keyboard, use the top centre) and run a wave from it both ways round the rim: each frame, displace every sample along its normal by amp · gaussian((distance round the rim − front) / width) · cos(phase), where the front moves at the rim's length per 0.9s and amp decays from 5.5px with a 0.42s time constant. After 1.4s it settles back to the plain outline. At the same time the label becomes '✓ Nudged' in green and the rim turns green for 2.4s, announced politely. Reduced motion skips the wave but keeps the confirmation. Selected variant — Night (night): Palette for this theme (Night): --rrb-done #7fd1a8; --rrb-face #17151b; --rrb-ink #efe8dc; --rrb-rim #b9cce4. Treat these as the root colour tokens, one value per role, and name them to suit your code. Select it with the theme option set to "night". Keep every dimension, spacing value, state and motion from the brief unchanged, and keep text at 4.5:1 contrast or better on these surfaces. 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: Press to nudge; a wave runs round the rim from where you pressed. Motion: Wave travels round the rim in 0.9s with exponential decay; done state holds 2.4s. Accessibility: A real button; the label change is in an aria-live region. Keyboard presses start the wave from the top. Reduced motion removes the wave. Responsive behavior: The rim is resampled from the measured size, so any label fits. 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
Press to nudge; a wave runs round the rim from where you pressed.
Motion
Wave travels round the rim in 0.9s with exponential decay; done state holds 2.4s.
Accessibility
A real button; the label change is in an aria-live region. Keyboard presses start the wave from the top. Reduced motion removes the wave.
Responsive
The rim is resampled from the measured size, so any label fits.