This component no longer exists. It was in ns-ui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-07 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
Button Glass
ns-ui/button-glassRemovedComponent
Liquid-glass button with translucent blurred surface and press states.
Live preview
live · rendered by the registry
Rendered by ns-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://design.helpmarq.com/r/button-glass.jsonSource
1"use client";23import { useState, type ButtonHTMLAttributes, type PointerEvent } from "react";45export function GlassButton({6 className = "",7 children,8 onPointerEnter,9 onPointerLeave,10 onPointerDown,11 onPointerUp,12 onPointerCancel,13 ...props14}: ButtonHTMLAttributes<HTMLButtonElement>) {15 // Real pointers drive the native `:hover`/`:active` pseudo-classes below just16 // fine. But a synthetic (`dispatchEvent`, `isTrusted: false`) pointer never17 // reaches the UA's own hover/activation state machine — Chromium confirmed18 // not to flip `:hover`/`:active` for script-dispatched events, even though19 // the same event fires every JS listener bound to it. That left this button20 // dead in the landing-page card, whose autoplay driver only has synthetic21 // events to offer. Mirroring both states into JS-tracked data-attributes22 // (additive, not a replacement) gives the driver something that responds,23 // without changing anything for a real mouse, touch, or keyboard press.24 const [hover, setHover] = useState(false);25 const [pressed, setPressed] = useState(false);2627 return (28 <button29 data-hover={hover}30 data-press={pressed}31 onPointerEnter={(e: PointerEvent<HTMLButtonElement>) => {32 setHover(true);33 onPointerEnter?.(e);34 }}35 onPointerLeave={(e: PointerEvent<HTMLButtonElement>) => {36 setHover(false);37 setPressed(false);38 onPointerLeave?.(e);39 }}40 onPointerDown={(e: PointerEvent<HTMLButtonElement>) => {41 setPressed(true);42 onPointerDown?.(e);43 }}44 onPointerUp={(e: PointerEvent<HTMLButtonElement>) => {45 setPressed(false);46 onPointerUp?.(e);47 }}48 onPointerCancel={(e: PointerEvent<HTMLButtonElement>) => {49 setPressed(false);50 onPointerCancel?.(e);51 }}52 className={[53 "group relative inline-flex items-center justify-center overflow-hidden rounded-sm px-5 py-2.5 text-sm font-medium text-foreground",54 // glass material: translucent fill, heavy blur, saturation boost55 "bg-black/[0.04] backdrop-blur-xl backdrop-saturate-150 dark:bg-white/[0.06]",56 "border border-black/10 dark:border-white/10",57 // depth: top specular edge (inset) + soft lift shadow58 "shadow-[inset_0_1px_0_0_rgba(255,255,255,0.5),0_4px_16px_-4px_rgba(0,0,0,0.15)]",59 "dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.12),0_8px_24px_-8px_rgba(0,0,0,0.5)]",60// … truncated
