No.05 · Buttons
Spotlight Group
A toolbar of buttons that share one light: a soft glow follows the pointer across the whole group and catches the edges of whichever buttons are near, spilling over their neighbours.
The prompt
Written for the variant you picked above: Night
Build a rich-text formatting toolbar (Bold, Italic, Underline | Link, Quote, List | Code, Image) as square 40px icon buttons in a 16px-radius tray, with thin dividers between groups. On pointermove over the tray, write the pointer's position in tray coordinates to --x/--y. Give each button a 1px border layer (a ::before with padding 1px and a content-box mask composited with exclude) whose background is radial-gradient(110px circle at calc(--x − --bx) calc(--y − --by), lilac, frost, transparent) over a faint resting rim, where --bx/--by are that button's offsetLeft/offsetTop measured with a ResizeObserver. Every button positions the same light in the same place, so one spot of light moves across the group, lighting the nearest edges brightest and spilling onto the neighbours. A matching soft wash inside each button and a larger, dimmer light on the tray's own border complete it. The light fades in on enter and out on leave. Toggles use aria-pressed and keep a soft lilac-to-frost gradient fill with a tinted ring; actions (Link, Image) don't stay pressed. Icons are 1.7px stroke SVGs. Selected variant — Night (night): Palette for this theme (Night): --spg-bg #121015; --spg-btn #19171d; --spg-ink #c9c2b6; --spg-ink-hot #ffffff; --spg-light #c8b9ea; --spg-light-2 #b9cce4; --spg-rim rgb(239 232 220 / 0.08); --spg-wash rgb(200 185 234 / 0.16). 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: Move across the toolbar and the light follows you over every button's edge. Click a toggle to switch it; actions fire once. Motion: The light tracks the pointer directly; it fades in and out over 300ms. Accessibility: A labelled role=toolbar of real buttons with one tab stop and arrow-key, Home and End navigation, each named by aria-label (with a matching title tooltip); toggles expose aria-pressed. Focus-visible draws an outline. The light is decorative and needs no motion setting, since it only moves with the pointer. Responsive behavior: Wraps onto a second row on very narrow screens; offsets are re-measured on resize. Touch: Without hover the edges rest at their faint rim; pressed toggles still show their fill. 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
- Move across the toolbar and the light follows you over every button's edge. Click a toggle to switch it; actions fire once.
- Motion
- The light tracks the pointer directly; it fades in and out over 300ms.
- Accessibility
- A labelled role=toolbar of real buttons with one tab stop and arrow-key, Home and End navigation, each named by aria-label (with a matching title tooltip); toggles expose aria-pressed. Focus-visible draws an outline. The light is decorative and needs no motion setting, since it only moves with the pointer.
- Responsive
- Wraps onto a second row on very narrow screens; offsets are re-measured on resize.
- On touch
- Without hover the edges rest at their faint rim; pressed toggles still show their fill.