Skip to content

No.14 · Buttons

Glass Slab Button

A button made like a thick glass tile: its bevel's bright line turns to face the pointer, a soft beam slides through the glass, and pressing sinks the slab.

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

Build a button that looks like a thick tile of dark glass (60px tall, 16px radius): a near-black face with a faint glow of the glow colour from the top, a top inner highlight, a dark inner shadow at the bottom and a coloured drop glow. The bevel is a 1.5px ring made with a pseudo-element masked to its border (content-box exclude); its fill is a conic gradient bright in the glow colour (whitening at the peak) over about 60°, transparent elsewhere, rotated by a registered --a angle that points at the pointer (atan2 from the button's centre, converted to conic's zero at top), transitioning over 380ms — so the lit edge swings round to face you, the way light catches the bevel of real glass. On hover a soft diagonal beam (blurred 105° band in the glow colour) appears inside the glass and slides with the pointer's x. The label has a faint glow. Pressing sinks the slab 1px with a deeper inset shadow. Glow colour is a prop. Selected variant — Violet (violet): glow="#c25cff": neon violet bevel, beam and drop glow on a violet-black page (#07040e). 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 it and the lit edge turns to face the pointer while a beam slides through; press to sink it. Motion: Rim angle 380ms (registered @property); beam 200–300ms; press 140ms. Accessibility: A real button; keyboard focus lights the full rim and shows a ring in the glow colour. Reduced motion removes the transitions. Responsive behavior: Sized by its label; works at any width. Touch: Taps work normally; pointer-only effects are skipped on touch. 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 it and the lit edge turns to face the pointer while a beam slides through; press to sink it.
Motion
Rim angle 380ms (registered @property); beam 200–300ms; press 140ms.
Accessibility
A real button; keyboard focus lights the full rim and shows a ring in the glow colour. Reduced motion removes the transitions.
Responsive
Sized by its label; works at any width.
On touch
Taps work normally; pointer-only effects are skipped on touch.