Glassmorphism UI Prompts for AI Coding Agents
A glassmorphism UI prompt for Claude, Cursor and v0: copy-paste prompts, a rules file and a review checklist for accessible glass and Liquid Glass UI.
By Lokendra Singh Rathore (GitHub, opens in a new tab)About the authorPublished Updated 6 min read




A good glassmorphism UI prompt does two things: it tells the agent what to build, and it forbids the shortcuts that make AI-generated glass look right in a screenshot and fail in use. This guide gives you copy-paste prompts for Claude, Cursor and v0, a rules file you can commit, a Liquid Glass variant and a checklist for reviewing what comes back.
Basis: the rules come from how we review glass UI in this repository, not from a test of any model; they name React 19.2+ and Tailwind CSS v4, the versions SheenUI requires. First published 8 Nov 2026, last revised 14 Nov 2026.
We make SheenUI, a glass component library. We did not benchmark any model, so nothing here claims that a prompt produces a certain score. The prompts encode rules we apply when reviewing glass UI, and the checklist shows how to verify the result instead of trusting it.
Why AI-generated glass usually fails
These are failure modes to check for, not statistics. Each one follows from how the CSS works:
- Contrast is never measured. A model can pick a tint that looks fine over the sample background and fails over the brightest part of the real one. Contrast on glass has to be sampled from rendered pixels (see the accessibility guide).
- Too much blur, applied everywhere. Blur is a render pass per surface. Stacking many blurred cards, or blurring inside a blurred parent, costs frames and adds nothing (performance guide).
- A wrapper with
opacityorfilter. An ancestor withopacitybelow 1, afilteror amaskbecomes a backdrop root, and the glass inside blurs nothing behind the page. A fade-in animation on a wrapper does this silently. - No fallbacks. Reduced transparency, more contrast and forced colors need solid surfaces. Prompts that do not ask for them do not get them.
- Invented CSS each time. Without a spec, every component gets slightly different blur, tint and borders, and focus handling and keyboard behavior are rewritten from scratch.
- Animating the wrong things.
transition: alland animated blur radius instead of transform and opacity.
The prompt
Paste this into a chat tool, or use it as the task text in an agent. It works without any library: it states the recipe and the constraints. Replace the bracketed parts.
Two details make it stronger. Name the real background (a gradient, an image, the color of the section above), because the model cannot reason about contrast without it. And ask for the verification, not just the code: "say how you checked" makes the agent state its assumptions, which you can then test.
With SheenUI
If you use a component library, tell the agent to use it and not rewrite the glass. SheenUI is a copy-the-source library: its @sheenui/theme package is not on npm yet, so you add components with the shadcn CLI or copy the folders you need into your app (the README, the install guide, the installation page and each docs page list them; tell the agent about the Tailwind CSS v4 setup too, since the glass tokens depend on it). The agent can then read real source, and that is where it helps: every exported component and hook carries a doc comment with its props, a compiling @example, and keyboard and accessibility notes, so an agent that opens glass-card.tsx learns the API from the file. A lint rule enforces the comment on every export, and pnpm examples:check compiles every example.
Here is what good output looks like with it. The agent should reach for GlassCard, Dialog and Button instead of writing CSS:
See the Glass card, Dialog and Button pages for the props.
A rules file the agent always reads
Put the stable rules in the file your tool loads on every task. Claude Code reads CLAUDE.md (memory docs (opens in a new tab)); Cursor reads AGENTS.md and .cursor/rules/*.mdc files with description, globs and alwaysApply frontmatter (Cursor docs (opens in a new tab)). A short version for SheenUI:
For Cursor, the same text goes in .cursor/rules/glass.mdc below a frontmatter block such as description: "Rules for glass UI" and alwaysApply: true.
The shadcn MCP server, the registry and llms.txt
The shadcn MCP server lets an assistant browse and install from registries listed in components.json; setup for Claude Code is pnpm dlx shadcn@latest mcp init --client claude, and Cursor, VS Code and Codex are supported (shadcn MCP docs (opens in a new tab)). Third-party registries are added by @namespace in components.json.
SheenUI's registry is built: 183 items (the shared theme, every component and chart, and the blocks) plus 5 install bundles, served at https://lokendra-builds.github.io/sheenui/r/<name>.json once the docs site is deployed. The shadcn CLI installs from those URLs (tested with shadcn 4.23.0 on Next.js and Vite, see the install guide). We did not test the MCP server against it, and the registry is not listed under a @namespace yet, so with MCP you would give the agent the full URL. We have not published an agent skill either, so there is no npx skills add command to give you.
What does exist is a machine-readable index. The demo build writes llms.txt (an index of a few dozen KB, one line per page) and llms-full.txt (more than a megabyte, with each page's intro, files to copy, props and an example). Once the site is deployed they sit at the site root. The full file is too large for many contexts: give the agent llms.txt and let it fetch the pages it needs, or paste only the relevant sections.
A Liquid Glass prompt
Liquid Glass needs different constraints, because its refraction only works in Chromium and costs more per area:
With SheenUI, the agent should use LiquidGlass (see the Liquid glass page and the CSS and React guide), which already does all of the above.
A review checklist for AI output
Run these against whatever the agent produced:
- Contrast. Sample the rendered pixels behind text, light and dark, with the script in the accessibility guide. Do not accept "I used white at 70%" as evidence.
- Fallbacks. Emulate
prefers-reduced-transparency,prefers-contrast: moreand forced colors, and confirm the surface turns solid. The same guide has a Playwright script. - Wrappers. Search for
opacity,filter,maskandmix-blend-modeon ancestors of glass. - Budget. Count blurred surfaces in view. More than 8, or glass inside glass blur, means rework.
- Keyboard. Tab through everything; open and close each overlay with Escape; confirm a visible focus ring that is not a
box-shadow. - Motion. Turn on reduced motion and confirm that movement becomes a fade.
- No invented API. If the agent used a component or prop that does not exist in your copy of the source, it guessed. Type-check.
Following up when the first result is wrong
Short, specific follow-ups work better than rewriting the prompt. Three that map to the checklist:
- "List every text element and its worst-case contrast over the brightest part of the background. Raise the tint on any under 4.5:1 and show the new numbers."
- "Find any ancestor of a glass element with opacity, filter, mask or mix-blend-mode, and move that property onto the glass element itself."
- "Add the reduced-transparency, more-contrast and forced-colors rules, and show the computed background and backdrop-filter under each."
Asking for the evidence each time keeps the agent honest, and it gives you something to paste into a code review.
When not to rely on prompts
A prompt reduces repeated mistakes; it does not replace the checks above. Models change, and a prompt that works on one version may not on the next. Do not use glass prompts for data-dense screens: ask for solid surfaces there. And do not let an agent decide your brand colors: give it the tokens.