Controls
Glass Button
Pressable glass button with refractive layers, local light, and keyboard-safe press states.
Preview
Release demos ready. Update 0.
Installation
First add the exact @glassyui mapping to components.json as shown in Getting Started. Then run the pinned item command:
pnpm dlx [email protected] add @glassyui/glass-buttonDirect registry declarations
These values belong to @glassyui/glass-button itself in registry.json.
Package dependencies
clsx
Registry dependencies
@glassyui/glass-provider
File targets
components/glassyui/glass-button.tsxcomponents/glassyui/lib/merge-refs.tscomponents/glassyui/lib/use-local-light.ts
Complete installed closure
This follows every namespaced registry dependency recursively and de-duplicates the packages and target files installed with this item.
Package dependencies
clsx
Installed files
components/glassyui/glass-button.tsxcomponents/glassyui/lib/merge-refs.tscomponents/glassyui/lib/use-local-light.tscomponents/glassyui/glass-provider.tsxcomponents/glassyui/liquid-filters.tsxcomponents/glassyui/lib/preferences.tscomponents/glassyui/styles/liquid.css
Usage
import { GlassButton } from "@/components/glassyui/glass-button";
export function ButtonDemo() {
return <GlassButton>Save changes</GlassButton>;
}Examples
<div className="flex gap-3">
<GlassButton variant="primary">Primary</GlassButton>
<GlassButton variant="soft">Soft</GlassButton>
<GlassButton variant="ghost">Ghost</GlassButton>
</div>API
GlassButtonForward-ref native button with owned glass interaction state.
GlassButtonPropsNative button props plus Glassy UI interaction and material options.
ButtonVariantExported primary, soft, or ghost visual-intent type.
ButtonSizeExported sm, md, or lg size type.
variantVisual intent: primary, soft, or ghost.
sizeControl size: sm, md, or lg.
presetMaterial preset applied to the button surface.
interactiveDisables pointer lighting when set to false.
Notes
Accessibility
Keep the Radix-backed semantics intact and preserve visible labels, focus states, and keyboard operation when copying the source.
Performance
Use provider quality preferences for dense app screens. Reserve strong refraction for hero or showcase surfaces.