Liquid Glass design system for React 19 and Tailwind CSS 4: tokens, glass material, primitives and dashboard patterns
The Liquid Glass design system for React 19 and Tailwind CSS 4: tokens, a glass material, and the components built from them.
Two applications that want the same frosted-glass look usually end up with two copies of it: drifting colours, hand-tuned blurs, and buttons that are almost the same. glass-ui is the one copy. It was lifted out of Luna Watch so that more than one product can be built from the same material, and it now also carries AgentDock's whole web UI.
Who it is for: React 19 applications on Tailwind CSS 4 (Next.js included) that want a consistent glass look, from a television-style "sofa" interface to a dense desktop dashboard, without writing their own primitives.
@andrewbehma/glass-ui — npm i @andrewbehma/glass-uidata-theme, data-material, data-scale, data-accent,
data-palette, data-profile) for light/dark, glass/flat, sofa/desk
density, a named accent preset, a named surface palette and the desk's
workspace profile.glass, glass-strong, glass-clear and lit for
chrome, surface-content for content, and the .canvas behind them, with
the fallbacks they need.'use client', so they render from React
Server Components with no transpilePackages.Three layers, imported separately so an application can take the first two and decline the third:
| Import | What it is |
|---|---|
@andrewbehma/glass-ui/tokens.css | The palette, the radius, motion, density and type scales, the z-index ladder, and the four axes below. Declares its own @source, so a consumer does not have to know that Tailwind cannot see into node_modules. |
@andrewbehma/glass-ui/material.css | glass, glass-strong, glass-clear and lit, surface-content, the .canvas layer, and every fallback they need. |
@andrewbehma/glass-ui/base.css | Opinions that apply to a whole document: the focus ring, the reduced-motion override, the depth effect under a sheet. Optional. |
@andrewbehma/glass-ui | The primitives and cn. |
Contents: Install · Quick start · The look · The rules · Motion · The shell patterns · The workspace patterns · The data primitives · The widget grid · Desk dashboard primitives · Desk activity primitives · Desk automation primitives · File input · Calm pages · Developing · Releasing · License
npm i @andrewbehma/glass-ui
# or: bun add @andrewbehma/glass-ui / pnpm add @andrewbehma/glass-ui
The package ships compiled ESM and type declarations in dist/, one file per
source module, with every subpath (@andrewbehma/glass-ui/button,
@andrewbehma/glass-ui/dialog, @andrewbehma/glass-ui/tokens.css, …) in its
exports map. The client components keep their 'use client' directive, so
they can be rendered straight from a React Server Component. No
transpilePackages is needed in Next.
Peer dependencies. The application provides these:
npm i react react-dom tailwindcss lucide-react motion sonner \
@radix-ui/react-dialog @radix-ui/react-dropdown-menu @radix-ui/react-popover \
@radix-ui/react-tooltip @radix-ui/react-context-menu @radix-ui/react-slider
cron-parser, cronstrue, @xterm/xterm and @xterm/addon-fit are optional,
needed only by @andrewbehma/glass-ui/cron-input and
@andrewbehma/glass-ui/terminal — see Desk automation
primitives.
lucide-react is a peer dependency on a permissive range on purpose: its icon
names have moved between major versions, and an application should be able to
upgrade its icons without waiting for this package.
Stylesheets and Tailwind 4. Import the layers from the application's global stylesheet, after Tailwind:
@import
Button danger label and field focus ring fail contrast in light, outside the workspace profile
https://github.com/AndreyBegma/glass-ui/issues/170
Labels: None
Button / Board: icon buttons' coarse-pointer hit area is narrower than 44 px
https://github.com/AndreyBegma/glass-ui/issues/160
Labels: None
fix(board): card li squashes in a height-bounded column — add shrink-0
https://github.com/AndreyBegma/glass-ui/issues/147
Labels: None
feat: disabledReason on Button/Select/Toggle and an InfoHint term popover
https://github.com/AndreyBegma/glass-ui/issues/88
Labels: None
fix: popovers (Combobox) inside Toolbar filters are clipped by the scroll row
https://github.com/AndreyBegma/glass-ui/issues/87
Labels: bug, good first issue
feat: MenuCheckboxItem — a checkbox item in the shared Menu
https://github.com/AndreyBegma/glass-ui/issues/76
Labels: enhancement, good first issue
No CONTRIBUTING document was found. Please check the README and open issues.