Guide
Add Glassy UI to a React app with shadcn
Install a glass component, reproduce a complete demo, and customize the source in your own React app.
Start with the app you already have
Glassy UI copies source into a React 19+ and Tailwind CSS 4 app. You can inspect and edit every installed file. There is no Glassy UI runtime package and no account to create.
If your app already has a shadcn components.json, keep it. Otherwise initialize shadcn first:
npx shadcn@4.14.1 initInstall one component
npx shadcn@4.14.1 add @glassyui/glass-buttonGlassy UI is in the shadcn registry directory, so @glassyui needs no setup. Each component page also offers pnpm, yarn and bun commands, plus a Manual tab with the packages and complete source files.
Set data-lg-theme="light" on a light app’s root element, or data-lg-theme="dark" on a dark app’s. Keep this attribute in sync with your app’s theme switch.
<html lang="en" data-lg-theme="light">
<body>{children}</body>
</html>import { GlassButton } from "@/components/glassyui/glass-button";
export default function Page() {
return <GlassButton variant="prominent">Explore projects</GlassButton>;
}The registry resolves shared files and package dependencies. Its provider module imports the glass stylesheet automatically. A provider wrapper is optional for a simple button; add one when you want synchronized preferences across your app.
Reproduce a complete example
Open Glass Scene, Glass Lens, or Glass Dock. Their Usage sections contain the same source that renders the preview, including the artwork. Save that source in the named file, run its example install command, then import its exported component.
A scene composition uses more than the scene renderer: its panels and buttons need installing too. The example command includes those dependencies. This is separate from the command for the primitive alone.
Make it yours
Use className for size, spacing and color. Component defaults sit in a CSS cascade layer, so Tailwind utilities can override them without !. Preserve the accessibility preference rules when editing the source.
Glass needs a backdrop to be visible. CSS frost blurs what is behind a surface; the refractive scene uses the image you supply. A glass panel on a flat background will look quieter than the same panel over a detailed image.
If an import cannot resolve, check the installed target path against your app aliases. The installation reference explains the shared files and optional provider.