Guide
Documentation
Everything you need to design, export and ship liquid glass components.
Getting started
Open the builder. You will see three areas: controls on the left, the stage in the middle and the code panel on the right (on tablets and phones the code opens as a drawer from the Export button).
- Pick an element in the top bar.
- Move through the control groups: Shape, Material, Refraction, Light & Edge, Depth, Motion and Content.
- Switch to Hover or Pressed to design interaction states.
- Press Export, choose a tab and copy or download the code.
Your work is saved automatically in your browser. Close the tab and it will be there when you return.
The interface
Top bar
Element switcher, undo and redo, reset, share link, interface theme and the Export button. On phones the secondary actions live in the ⋯ menu.
Stage
The stage shows your element over a scene. Drag anywhere on the stage to move the element; double-click to centre it again. The toolbar at the bottom lets you change the scene, zoom between 75% and 200% and turn on Live interaction, which lets you hover and click the element as a real visitor would.
The badge on the left tells you whether your browser renders SVG refraction. If it shows the fallback message, the export still contains the refraction filter for Chromium users.
Controls
Each control shows its value next to its name. Type an exact number or drag the slider. Double-click a control’s name to reset it. Controls marked Shared are the same in every state (for example refraction and sweep settings).
Elements
| Element | HTML | Size controls |
|---|---|---|
| Button | button with optional icon | Padding X/Y, radius, font size, weight, letter spacing |
| Icon button | button with aria-label | Size, radius, icon size |
| Card | article with heading and text | Width, padding, radius, typography |
| Pill navigation | nav with links, first is current | Item padding, gap, radius, typography |
| Input field | label wrapping an input | Width, height, horizontal padding, typography |
States: Base, Hover and Pressed
Base is the resting look. Hover and Pressed start from Base and only store what you change — a small dot appears next to every overridden control, and clicking the dot resets that control to the Base value. The counter on each state tab shows how many properties it overrides.
- Hover also applies to keyboard focus (
:focus-visible), so keyboard users get the same feedback. - For input fields, Hover also applies while the field is focused (
:focus-within). - Pressed is available for buttons, icon buttons and pill navigation.
While you edit Hover or Pressed, the stage shows that state permanently. Turn on Live interaction to test real hovering.
Material
- Tint color / strength — the colour mixed into the glass. Low values (0.04–0.12) keep it clear; higher values make it milky or smoked.
- Frost (blur) — background blur. Clear liquid glass uses 0–6 px; frosted glass 10–20 px.
- Saturation — boosts colour coming through the glass. 140–190% feels natural.
- Brightness — lifts or darkens what is behind the glass.
- Element opacity — fades the whole component, including text.
- Grain texture — a subtle noise layer that hides banding on large surfaces.
- Text color, opacity and shadow — keep text readable over busy backgrounds.
Refraction
Refraction is produced by an SVG feDisplacementMap inside backdrop-filter. UIGlass generates the displacement map from your element’s proportions and corner radius.
- Strength — maximum displacement in pixels. It is automatically limited on small elements so the lens stays believable.
- Bezel width — how far the curved edge reaches inwards.
- Edge softness — how gradually the curve fades into the flat centre.
- Lens type — convex pulls the background outwards, concave pushes it inwards.
- Chromatic aberration — offsets the red and blue channels for a prism fringe. Each extra pixel costs a little performance, so keep it modest on pages with many glass elements.
Refraction renders in Chromium browsers. Everywhere else the frosted glass you designed is shown automatically. See browser support.
Light & Edge
- Light angle — where the light comes from (0° is the top, 315° is the top-left).
- Rim highlight and width — the bright edge on the lit side.
- Inner glow — soft light spilling into the glass from the lit edge.
- Back-edge caustic — the thin highlight on the opposite edge, typical of thick glass.
- Shade color and inner shade — darkening on the far side.
Depth
Drop shadow lifts the element from the page, shadow color tints it, and outer glow with its own colour and size adds a halo — useful for primary actions on dark backgrounds.
Motion
- Lift and scale are per state: a typical hover uses −1.5 px lift and 1.02 scale; pressed uses 0 lift and 0.97 scale.
- Transition duration and easing apply to every state change. Spring overshoots only on movement, never on colours.
- Light sweep draws a band of light across the element on hover and back when the pointer leaves.
Content and export names
Edit labels, icons, card text, navigation items and placeholders. Export class name replaces the default class (for example glass-button), and Export units switches lengths between px and rem.
Scenes
Use the Scene button on the stage toolbar. Built-in scenes include Aurora, Typography, Stripes, Grid, Sunset and Daylight. You can also set a solid colour, paste an image URL or preview a local image — local images never leave your device. Turn on Animate scene to see how the glass reacts to a moving background.
Presets
Open the Presets tab to start from the presets or from My designs. Press Save (Ctrl+S) to keep a design in My designs: without an account it stays in this browser; signed in, it is saved to your account and opens on any device. Each preset also has its own page with a live preview and copy-ready code.
Exporting
| Tab / download | What you get | Use it when |
|---|---|---|
| CSS | One class per element, custom properties, states, fallbacks | Any website or framework |
| HTML | Markup, SVG filter and the refraction check script | Static pages, CMS blocks |
| React | JSX component importing its CSS file | React, Next.js, Remix |
| JSON | The complete design | Back-ups, sharing, re-importing |
| Full demo page | A standalone HTML file | Showing a design to your team |
The Import button accepts any UIGlass JSON file. Every value is validated and clamped, so a damaged or hand-edited file cannot break the builder.
Using the code
Plain HTML or any CMS
- Paste the CSS into your stylesheet.
- Paste the element markup where you need it.
- Paste the SVG filter and the small script once per page, ideally before the closing
bodytag. The script adds thelg-refractclass to the document only in browsers that support SVG backdrop filters.
WordPress
Add the CSS through Appearance → Customize → Additional CSS or your child theme’s stylesheet. Put the markup in a Custom HTML block, and the SVG filter plus script in the same block or in your footer. If you use a page builder, its HTML widget works the same way.
React and Next.js
Save the CSS next to the component and import it, as the generated component does. Render the SVG filter once — for example in your root layout — and run the refraction check on the client:
useEffect(() => {
const brands = navigator.userAgentData?.brands || [];
if (brands.some(b => /Chromium/.test(b.brand))) {
document.documentElement.classList.add("lg-refract");
}
}, []);
Vue, Svelte and others
The CSS is framework-agnostic. Use the HTML tab, change class bindings as your framework requires and add the filter once in your app shell.
Tailwind CSS
Keep the exported CSS as a regular stylesheet and apply the class alongside your utilities, for example class="glass-button mt-6". Avoid Tailwind’s backdrop-* utilities on the same element so they don’t override the glass.
Browser support
Frosted glass (backdrop-filter) works in all current major browsers. The SVG refraction lens is rendered by Chromium-based browsers. Details and a full table are on the browser support page.
Accessibility
- Check text contrast against the busiest area your glass will sit on, not the average. Raise tint strength or text shadow if needed.
- Exports include
:focus-visibleoutlines; keep them. prefers-reduced-motiondisables transitions and the light sweep.prefers-reduced-transparencyreplaces glass with a solid, readable surface where the browser supports it.
Read more in Accessible glass UI.
Performance tips
- Backdrop filters are rendered by the GPU. A handful of glass elements is fine; dozens of large ones on one screen are not.
- Chromatic aberration triples the displacement work — use it on hero elements, not on every list item.
- Prefer clear glass with small blur values; large blur radii are the most expensive part.
- Avoid animating the size of glass elements continuously.
Keyboard shortcuts
| Shortcut | Action |
|---|---|
| Ctrl/⌘ + Z | Undo |
| Ctrl/⌘ + Shift + Z or Ctrl + Y | Redo |
| E | Open or close the code panel |
| B / H / P | Edit Base, Hover or Pressed |
| ? | Show shortcuts |
| Esc | Close panels and dialogs |
Troubleshooting
The refraction badge says “fallback” in Chrome.
Make sure hardware acceleration is enabled in your browser settings and that no extension forces a different user agent. Reload the page after changing it.
The exported element looks flat on my site.
Glass needs something behind it. Place it over an image, gradient or text. Also check that a parent element doesn’t set overflow: hidden with isolation in a way that hides the backdrop, and that the SVG filter is present on the page.
Two components share the same refraction.
Each filter has an ID based on the class name. Give each component a unique Export class name before exporting.
My hover state does nothing.
Check the Hover tab counter. If it shows no overrides, Hover is identical to Base. Also make sure another stylesheet isn’t overriding :hover with higher specificity.