No.03 · Buttons
Ticker Ring Button
A button with its announcement written around the border: a line of small capitals runs along it like a ticker, and hovering slows it down so you can read it.
The prompt
Written for the variant you picked above: Night
Build a pill button with a 13px band around a solid face ('Book a table'). In the band, an SVG textPath runs a short announcement in mono capitals ('WINTER MENU FROM 14 NOV ·') around the pill. Measure the button with a ResizeObserver and build the pill-shaped loop through the band's centre; repeat the line enough times to go round once and pin it to exactly the loop's length with textLength + lengthAdjust=spacing, so it closes without a gap. Move it with requestAnimationFrame by advancing startOffset, using two copies one lap apart (offset o and o − length) so there's never a seam. The speed eases from 26px/s to 7px/s while the button is hovered or focused, so it slows to be read, and the ticker text and the face's rim light up in the theme's hot colour. The ticker text is also the button's accessible description. Reduced motion leaves it still. Selected variant — Night (night): theme="night": a near-black band (#1c1a20) with warm grey ticker text (#c9c2b6) around a cream face (#efe8dc); on #0d0b0a. 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: Hover or focus to slow the ticker; press to act. Motion: Ticker moves at 26px/s, easing to 7px/s on hover; colours fade 300ms. Accessibility: A real button whose name is its label; the ticker text is linked with aria-describedby, and the SVG is hidden from assistive tech. Reduced motion stops the ticker. Responsive behavior: The ring is rebuilt from the button's measured size, so any label length works. 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 or focus to slow the ticker; press to act.
- Motion
- Ticker moves at 26px/s, easing to 7px/s on hover; colours fade 300ms.
- Accessibility
- A real button whose name is its label; the ticker text is linked with aria-describedby, and the SVG is hidden from assistive tech. Reduced motion stops the ticker.
- Responsive
- The ring is rebuilt from the button's measured size, so any label length works.