Skip to content

No.10 · Buttons

Neon Tube Button

A border made from a bent glass tube with its electrodes meeting underneath: unlit at rest, it strikes, stutters twice and holds when you point at it.

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

Build a pill button whose border is a neon tube, drawn in SVG from the button's measured size. The tube path starts just right of a 14px gap at the bottom centre, runs clockwise round the pill and ends just left of the gap; two small dark rounded caps sit either side of the gap as electrodes. Unlit, the tube is pale glass: a 4.5px translucent white stroke with a thin highlight just above it, and the label is dim. Lit, three strokes stack on the same path — a wide blurred bloom in the gas colour, the 4.5px gas stroke with a drop-shadow, and a 1.4px near-white core — and the label takes the gas colour with a two-layer text glow. Hover or focus lights it with a single 700ms strike animation (on, drop to 15%, back, drop to 25%, then hold at full) applied to both the tube and the label; it never flickers once lit. Pressing whitens the core. Gas colour is a prop. Reduced motion lights it without the flicker. Selected variant — Pink (pink): color="#ff4fa3" (pink neon) on radial-gradient(70% 60% at 50% 45%, #1d1820, #0a080b 75%). 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 light the tube; press to act. Motion: One 700ms strike sequence on light-up; fades out over 320ms. Accessibility: A real button with a text label; the tube is decorative SVG. The lit label stays readable against the dark background. Reduced motion removes the flicker. Responsive behavior: The tube is rebuilt from the button's 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
Hover or focus to light the tube; press to act.
Motion
One 700ms strike sequence on light-up; fades out over 320ms.
Accessibility
A real button with a text label; the tube is decorative SVG. The lit label stays readable against the dark background. Reduced motion removes the flicker.
Responsive
The tube is rebuilt from the button's measured size, so any label fits.