Skip to content
Founding Lifetime: every Pro skillfirst 100 members · $169 onceUpgrade
Lookbk
Sign In
Effect guide

Liquid glass CSS: real refraction with an SVG filter

Glass that bends what is behind it near its edges, the way Apple’s Liquid Glass does, instead of only blurring it. How the refraction works, a CSS and SVG starter and a React component that we ran in Chromium, Firefox and WebKit, what each browser draws, and the skills that build finished liquid glass heroes and films.

Free skills to start. Pro is $79 a year for every skill, or $9.99 a month for 10. See pricing

What is a liquid glass effect?

Liquid Glass is the material Apple introduced on 9 June 2025 across iOS 26, iPadOS 26, macOS Tahoe 26, watchOS 26 and tvOS 26. Apple’s announcement calls it a translucent material that “reflects and refracts its surroundings”, and its design guidelines keep it to the controls and navigation that float above content, such as tab bars and sidebars, rather than the content itself.

On the web, a liquid glass effect is a panel that does what glassmorphism does, blurring and tinting whatever sits behind it, plus the part that makes it read as glass: near the edges the background bends, as if the panel were a thick slab with a rounded rim. Straight lines bow, letters stretch into the bevel and the middle stays clear. Glassmorphism stops at the blur.

CSS has no refraction property. The bend comes from an SVG filter: backdrop-filter accepts a url() that points at one, and feDisplacementMap inside it moves each pixel of the backdrop by an amount it reads from a map image. Chromium browsers draw it. Firefox and Safari skip it, so a page that works everywhere puts the bend on its own layer above a frosted one.

How the effect works

feDisplacementMap reads two channels of a map image, here red for left and right and green for up and down. Each pixel of the result shows the backdrop from a nearby point: where the map is above 128 that point lies further right or further down, below 128 further left or up, by up to half the filter’s scale in pixels. 128 leaves the pixel where it is. So the map is a picture of the glass: flat grey in the middle, and ramps of red and green where the bevel curves.

In the starter, pixels near each edge show the backdrop from further in, and the shift fades to nothing across a 44 pixel bevel. That stretches the content at the rim like the edge of a thick lens. Reading inward is deliberate: in our test, Chromium gave the filter only the backdrop inside the element’s own box, so a map that reached outside it repeated pixels from inside the edge instead of showing the page beyond.

Firefox and Safari accept the declaration, and CSS.supports() reports it as supported in all three engines, but they draw nothing for a backdrop-filter that contains url(), and they drop a blur written in the same declaration too. That is why the bend sits on its own layer, with the frost, tint and highlights on a second layer that every current browser draws.

  1. 01

    Draw the map

    Red ramps across the left and right edges, green across the top and bottom, 128 everywhere else. Two linear gradients in a small SVG, combined with mix-blend-mode: screen, make it without a canvas.

  2. 02

    Wire up the filter

    feImage loads the map from a data: URL and feDisplacementMap moves the backdrop by it. Set color-interpolation-filters to sRGB, so 128 really means no movement.

  3. 03

    Stack the layers

    First a layer with backdrop-filter: url(#liquid-glass), then one with a 1 pixel blur, a tint and inset highlights, then the content on top.

  4. 04

    Match the size

    The map is drawn in pixels for one panel size. When the panel changes size, draw it again, as the React version does with a ResizeObserver.

HTML

Liquid glass in CSS and SVG

A 320 by 180 pixel card over a grid, two shapes and a large word. Chromium browsers bend the backdrop at the rim; Firefox and Safari draw the same card frosted, without the bend. With reduced transparency or more contrast turned on, the card turns solid or nearly solid.

<div class="scene">
  <p class="scene-word" aria-hidden="true">Liquid</p>
  <div class="glass">
    <span class="glass-lens" aria-hidden="true"></span>
    <span class="glass-frost" aria-hidden="true"></span>
    <div class="glass-body">
      <p class="glass-kicker">Now playing</p>
      <p class="glass-title">Night Drive</p>
      <button type="button">Pause</button>
    </div>
  </div>
</div>

<!-- The refraction: a 44px bevel around a 320 x 180 card. The map's red
     channel moves pixels sideways, green moves them up and down, and 128
     (the flat middle) leaves them alone. -->
<svg width="0" height="0" style="position:absolute" aria-hidden="true">
  <filter id="liquid-glass" x="0" y="0" width="320" height="180"
    filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
    color-interpolation-filters="sRGB">
    <feImage x="0" y="0" width="320" height="180" result="map" href="data:image/svg+xml,
      <svg xmlns='http://www.w3.org/2000/svg' width='320' height='180'>
        <linearGradient id='x'>
          <stop offset='0' stop-color='%23ff0000'/>
          <stop offset='.0458' stop-color='%23b90000'/>
          <stop offset='.0917' stop-color='%238e0000'/>
          <stop offset='.1375' stop-color='%23800000'/>
          <stop offset='.8625' stop-color='%23800000'/>
          <stop offset='.9083' stop-color='%23710000'/>
          <stop offset='.9542' stop-color='%23460000'/>
          <stop offset='1' stop-color='%23000000'/>
        </linearGradient>
        <linearGradient id='y' x2='0' y2='1'>
          <stop offset='0' stop-color='%2300ff00'/>
          <stop offset='.0815' stop-color='%2300b900'/>
          <stop offset='.163' stop-color='%23008e00'/>
          <stop offset='.2444' stop-color='%23008000'/>
          <stop offset='.7556' stop-color='%23008000'/>
          <stop offset='.837' stop-color='%23007100'/>
          <stop offset='.9185' stop-color='%23004600'/>
          <stop offset='1' stop-color='%23000000'/>
        </linearGradient>
        <rect width='320' height='180' fill='url(%23x)'/>
        <rect width='320' height='180' fill='url(%23y)' style='mix-blend-mode:screen'/>
      </svg>"/>
    <feDisplacementMap in="SourceGraphic" in2="map" scale="40"
      xChannelSelector="R" yChannelSelector="G"/>
  </filter>
</svg>

<style>
.scene {
  position: relative; min-height: 420px; display: grid; place-items: center;
  overflow: hidden; font-family: system-ui, sans-serif;
  background:
    linear-gradient(90deg, rgb(255 255 255 / .14) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(rgb(255 255 255 / .14) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(circle at 30% 35%, #ff7a3d 0 13%, transparent 13.5%),
    radial-gradient(circle at 68% 64%, #4f7cff 0 17%, transparent 17.5%),
    #0f1324;
}
.scene-word {
  position: absolute; margin: 0; font: 800 clamp(96px, 22vw, 200px)/1 system-ui;
  letter-spacing: -.04em; color: #ffd166;
}
.glass {
  position: relative; width: 320px; height: 180px; border-radius: 36px;
  box-shadow: 0 12px 32px rgb(0 0 0 / .35);
}
.glass-lens, .glass-frost { position: absolute; inset: 0; border-radius: inherit; }
/* Bends the backdrop. Only Chromium browsers apply an SVG filter here;
   Firefox and Safari drop the whole declaration, so keep it on its own layer. */
.glass-lens { backdrop-filter: url(#liquid-glass); }
/* Frost, tint and highlights: every current browser draws this layer. */
.glass-frost {
  -webkit-backdrop-filter: blur(1px) saturate(160%);
  backdrop-filter: blur(1px) saturate(160%);
  background:
    radial-gradient(120% 80% at 20% 0%, rgb(255 255 255 / .16), transparent 55%),
    rgb(15 19 36 / .6);
  box-shadow:
    inset 1.5px 1.5px 0 rgb(255 255 255 / .6),
    inset -1px -1px 0 rgb(255 255 255 / .2),
    inset 0 0 0 1px rgb(255 255 255 / .12);
}
.glass-body {
  position: relative; height: 100%; box-sizing: border-box; padding: 26px 28px;
  display: flex; flex-direction: column; color: #fff;
}
.glass-kicker { margin: 0; font-size: 14px; font-weight: 600; }
.glass-title { margin: 4px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.glass button {
  margin-top: auto; align-self: flex-start; border: 0; border-radius: 999px;
  padding: 10px 20px; font: 600 15px system-ui; background: #fff; color: #0f1324;
}
/* People who ask for less transparency get a solid panel. */
@media (prefers-reduced-transparency: reduce) {
  .glass-lens, .glass-frost { display: none; }
  .glass { background: #232a44; }
}
@media (prefers-contrast: more) {
  .glass-lens { display: none; }
  .glass-frost { background: rgb(15 19 36 / .9); }
}
</style>

A starting point written for this page, free to use in your own projects. The skills below build the finished version with checks, fallbacks and a recorded video.

JSX

A liquid glass React component

The same layers as one component. It measures itself with a ResizeObserver and redraws the map for its size, gives each copy its own filter id with useId, and reads the two accessibility settings with matchMedia. We ran it with React 19.3.

import { useEffect, useId, useLayoutEffect, useRef, useState } from 'react'

// The refraction map for a w x h box, as a data: URL. Red moves pixels
// sideways, green moves them up and down, 128 leaves them alone. Inside the
// bevel, pixels are read from further in, so the rim magnifies like the edge
// of a thick lens.
function bevelMap(w, h, bevel) {
  const hex = (v) => v.toString(16).padStart(2, '0')
  const ramp = (id, size, vertical) => {
    const t = Math.min(bevel, size / 2) / size
    const stops = [[0, 255], [t / 3, 185], [(t * 2) / 3, 142], [t, 128],
      [1 - t, 128], [1 - (t * 2) / 3, 113], [1 - t / 3, 70], [1, 0]]
    const color = (v) => (vertical ? `#00${hex(v)}00` : `#${hex(v)}0000`)
    return `<linearGradient id='${id}' x2='${vertical ? 0 : 1}' y2='${vertical ? 1 : 0}'>` +
      stops.map(([o, v]) => `<stop offset='${o}' stop-color='${color(v)}'/>`).join('') +
      '</linearGradient>'
  }
  const svg = `<svg xmlns='http://www.w3.org/2000/svg' width='${w}' height='${h}'>` +
    ramp('x', w, false) + ramp('y', h, true) +
    `<rect width='${w}' height='${h}' fill='url(#x)'/>` +
    `<rect width='${w}' height='${h}' fill='url(#y)' style='mix-blend-mode:screen'/></svg>`
  return `data:image/svg+xml,${encodeURIComponent(svg)}`
}

function useMedia(query) {
  const [matches, setMatches] = useState(false)
  useEffect(() => {
    const list = matchMedia(query)
    const update = () => setMatches(list.matches)
    update()
    list.addEventListener('change', update)
    return () => list.removeEventListener('change', update)
  }, [query])
  return matches
}

export function LiquidGlass({
  children,
  radius = 36,
  bevel = 44,
  strength = 40,
  tint = 'rgb(15 19 36 / .6)',
  style,
  ...rest
}) {
  const ref = useRef(null)
  const id = 'liquid-' + useId().replace(/[^a-zA-Z0-9]/g, '')
  const [size, setSize] = useState(null)
  const solid = useMedia('(prefers-reduced-transparency: reduce)')
  const contrast = useMedia('(prefers-contrast: more)')

  // The map is drawn for the element's size, so draw it again when that changes.
  useLayoutEffect(() => {
    const el = ref.current
    const measure = () => setSize({ w: el.offsetWidth, h: el.offsetHeight })
    measure()
    const observer = new ResizeObserver(measure)
    observer.observe(el)
    return () => observer.disconnect()
  }, [])

  const layer = { position: 'absolute', inset: 0, borderRadius: 'inherit' }
  const frost = 'blur(1px) saturate(160%)'
  return (
    <div
      ref={ref}
      {...rest}
      style={{
        position: 'relative',
        borderRadius: radius,
        boxShadow: '0 12px 32px rgb(0 0 0 / .35)',
        background: solid ? '#232a44' : undefined,
        ...style,
      }}
    >
      {size && !solid && !contrast && (
        <>
          <svg width="0" height="0" style={{ position: 'absolute' }} aria-hidden="true">
            <filter id={id} x="0" y="0" width={size.w} height={size.h}
              filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
              colorInterpolationFilters="sRGB">
              <feImage href={bevelMap(size.w, size.h, bevel)} x="0" y="0"
                width={size.w} height={size.h} result="map" />
              <feDisplacementMap in="SourceGraphic" in2="map" scale={strength}
                xChannelSelector="R" yChannelSelector="G" />
            </filter>
          </svg>
          {/* Chromium only; Firefox and Safari skip this layer. */}
          <span aria-hidden="true" style={{ ...layer, backdropFilter: `url(#${id})` }} />
        </>
      )}
      {!solid && (
        <span
          aria-hidden="true"
          style={{
            ...layer,
            WebkitBackdropFilter: frost,
            backdropFilter: frost,
            background: contrast
              ? 'rgb(15 19 36 / .9)'
              : `radial-gradient(120% 80% at 20% 0%, rgb(255 255 255 / .16), transparent 55%), ${tint}`,
            boxShadow: 'inset 1.5px 1.5px 0 rgb(255 255 255 / .6), inset -1px -1px 0 rgb(255 255 255 / .2), inset 0 0 0 1px rgb(255 255 255 / .12)',
          }}
        />
      )}
      <div style={{ position: 'relative' }}>{children}</div>
    </div>
  )
}

// Usage:
// <LiquidGlass style={{ width: 320, padding: '26px 28px', color: '#fff' }}>
//   <p>Now playing</p>
//   <h3>Night Drive</h3>
// </LiquidGlass>

What to get right on a real page

  1. 01

    Keep the bend at the rim

    Leave the middle flat so text sits on undistorted glass. Keep the largest shift under half the bevel’s width, or the content folds back on itself and the rim shows a mirrored band.

  2. 02

    Measure contrast on the worst spot

    Apple’s guidelines suggest a dark dimming layer of 35% opacity behind clear glass over bright content. For small text on the web, the starter needed a 60% tint before its 14 pixel label reached 4.5:1 over the brightest letters behind it.

  3. 03

    Design the frosted version first

    Firefox and Safari draw only the frost layer, so that is what many visitors see. Make it look finished on its own and treat the bend as an extra. @supports cannot tell the browsers apart here.

  4. 04

    Load the map from a data: URL

    In our test, Chromium ignored an feImage pointing at an element on the page (href="#map") inside backdrop-filter, while the same map as a data: URL worked. Write # as %23 inside it.

  5. 05

    Use it sparingly

    Each glass layer filters its backdrop again whenever what is behind it changes, and each one adds another pass. Apple’s guidelines also say to limit it to the most important functional elements.

  6. 06

    Respect the settings

    prefers-reduced-transparency works in Chrome and Edge 118 and later; Firefox has it behind a flag and Safari does not support it, per MDN’s compatibility data. Pair it with prefers-contrast, which all three support, and with prefers-reduced-motion if the glass moves.

Skills that build a liquid glass effect

The three heroes draw their glass in WebGL, so their refraction does not depend on backdrop-filter. The tour film uses the same backdrop-filter and SVG map as this page and renders it to an MP4 in headless Chrome.

  1. Liquid Lens Hero: an example of what it makes
    web
    Liquid Lens HeroClaude CodeCodexCursor+3 more agents

    Motion Heroes · Pro

    Liquid Lens Hero

    WebGL liquid glass lockup hero · page + embed · 1080p loop

    One heavy drop of liquid glass slides across your headline, printed on a specimen sheet. Inside the drop the letters are magnified; at its rim the world outside is bent into a squeezed ring with a thin red and blue fringe, with a specular rim and a glint lit from the top left, a soft contact shadow and a crescent of focused light. It follows the pointer on a spring, or glides on a closed 12-second figure.

    Worth knowing: The headline is three short lines at most, and visitors without WebGL see a still sheet with the plain headline.

    Needs: Node.js 18+, Chrome (or Chromium/Edge), and ffmpeg for the video

    See what Liquid Lens Hero makes
  2. Glass UI Tour Film: an example of what it makes
    video
    Glass UI Tour FilmClaude CodeCodexCursor+3 more agents

    Launch & Demo Films · Pro

    Glass UI Tour Film

    MP4 · 27.5 or 32.5 s · 1080p or 4K · with music

    Liquid glass built the way this page builds it: each panel’s backdrop-filter runs the footage behind it through an SVG displacement map made for that panel’s size and corner radius, then blurs, saturates and darkens it so text reads. Glass widgets rise, dock and morph into full panels of your UI over a moving background film, every move on a 96 BPM beat. Since the film is rendered in headless Chrome, the bend is in every frame of the MP4 whatever plays it.

    Worth knowing: It makes a 27.5 or 32.5 second video, not a live page.

    Needs: Node.js 22+ and FFmpeg

    See what Glass UI Tour Film makes
  3. Glass Metaballs Hero: an example of what it makes
    web
    Glass Metaballs HeroClaude CodeCodexCursor+3 more agents

    Motion Heroes · Pro

    Glass Metaballs Hero

    Animated WebGL hero · page + embed · 1080p loop

    Liquid glass that moves like liquid: a heavy core drop and a ring of clear droplets fuse like mercury, stretch into necks and pinch apart beside your headline. The glass refracts a wall of bold diagonal stripes in your colors, bending them through the thick middle and squeezing them into the rim with a thin red, green and blue fringe, a fresnel sheen, a softbox highlight and a caustic on the wall.

    Worth knowing: The glass bends drawn stripes, not a photo or your product.

    Needs: Node.js 18+, Chrome (or Chromium/Edge), and ffmpeg for the video

    See what Glass Metaballs Hero makes
  4. Glass Orbs Hero: an example of what it makes
    web
    Glass Orbs HeroClaude CodeCodexCursor+3 more agents

    Motion Heroes · Pro

    Glass Orbs Hero

    WebGL glass spheres · page + embed · 1080p loop

    Glass spheres traced in WebGL as real balls of glass float over a bold gradient poster with your word scrolling in rows. The poster shows inside each sphere upside down and magnified, with a thin rainbow at the rim, a studio reflection, a sharp highlight and a soft shadow. The spheres bob on springy loops and lean away from the pointer.

    Worth knowing: Long or multi-line slogans on the poster break up inside the spheres.

    Needs: Node.js 18+, Chrome (or Chromium/Edge), and ffmpeg for the video

    See what Glass Orbs Hero makes

Install

Build a liquid glass effect with your agent

Each skill is a SKILL.md folder, so it installs the same way in Claude Code, Codex, Cursor and other agents. The example below uses Liquid Lens Hero; each skill page has its own prompt.

1. Paste the install prompt

Your agent runs the installer. The first time, it shows a sign-in link so you can approve it in the browser.

Install the "Liquid Lens Hero" skill from Lookbk (https://lookbk.dev/skills/liquid-lens-hero).
1. Run: curl -fsSL https://lookbk.dev/cli.js | node - add liquid-lens-hero
2. If it prints a sign-in link, show it to me. When I say I approved it, run the same command again.
3. When the install finishes, read the SKILL.md it installed and tell me what you need from me to make the first result.

Or run it in a terminal

curl -fsSL https://lookbk.dev/cli.js | node - add liquid-lens-hero

2. Start a new session

Agents load skills when a session starts. The installer writes the folder where your agent looks:

Claude Code
~/.claude/skills/liquid-lens-hero
Codex
~/.agents/skills/liquid-lens-hero
Cursor
~/.agents/skills/liquid-lens-hero

3. Ask for the result

Describe it in plain words, for example:

Use the liquid-lens-hero skill to build a hero for our new typeface: the headline printed on a specimen sheet with a drop of liquid glass magnifying it, our lede and one call to action, plus a 12-second 1080p loop.

Another agent? Install a skill in any agent

FAQ

Questions

Still stuck? The guides cover installing, agents and licensing in more detail.

Read the guides
Can you make liquid glass with CSS only?

Not the bend. CSS alone gives you the blur, tint and highlights, which is glassmorphism. The refraction needs an SVG filter referenced from backdrop-filter, and only Chromium browsers draw that today. For the bend in every browser, draw the glass in WebGL.

Does liquid glass CSS work in Safari and Firefox?

Not the refraction. In our test, Safari 27.2 and Firefox 155 skipped backdrop-filter: url() and drew only the frosted layer under it. WebKit bug 245510 and Mozilla bug 1961378, which track this, were both open on 13 November 2026.

How do I make liquid glass in React?

Wrap the content in a component that renders a layer with backdrop-filter pointing at an SVG filter, a frosted layer, and the content. Give each copy its own filter id with useId, and redraw the displacement map when a ResizeObserver reports a new size. The component above does both.

What is the difference between liquid glass and glassmorphism?

Glassmorphism blurs and tints what is behind a panel. Liquid glass adds refraction: the backdrop bends near the panel’s edges as if through a thick, rounded slab, while the middle stays clear.

Is liquid glass bad for performance?

It costs more than a plain blur, because the browser runs a displacement filter over the backdrop as well, again whenever what is behind it changes. Keep it to a few small panels and check scrolling on a mid-range phone. A panel that changes size every frame also needs a new map every frame.

Can I get liquid glass as a video?

Yes. Glass UI Tour Film renders a liquid glass product tour to MP4, and Liquid Lens Hero, Glass Metaballs Hero and Glass Orbs Hero each record a frame-exact 1080p loop of the hero.