Building an iOS Liquid Glass Button on the Web

Dec 03, 2026

I really like Liquid Glass in iOS 26.
I want the same glass look on the web, but try to recreate it faithfully and you hit a wall in Safari.

Let’s see how far the web can go, and fake the look with CSS alone.

Refraction Comes From SVG Filters

What makes Liquid Glass look like glass is refraction.
The background bends near the edges.

On the web, this is done with an SVG filter. You draw a displacement map whose values grow toward the edges, and feDisplacementMap shifts the background pixels by that amount. The filter is then applied to whatever sits behind the button with backdrop-filter: url().

Open-source libraries like liquid-glass-react and glisse all work this way.

Safari Has No Refraction

The catch is that WebKit doesn’t support SVG filters in backdrop-filter.

Open Refraction in the demo below in both Chrome and Safari and the difference is obvious.
Safari drops the blur along with the refraction, leaving a bare transparent surface. The libraries fall back to a plain blur here, so you end up with an ordinary frosted glass surface.

On iOS, Chrome also runs on WebKit, so the result is the same.
If many of your users are on iPhone, adding a library means most of them still see no refraction.

@samasante/liquid-glass gets refraction working in Safari by filtering a copy of an element you choose instead of the backdrop. It bends that copy, though, not the page actually sitting behind the button.

Keeping the Texture Without Refraction

Even without refraction, light catching on the rim and a sense of convex thickness are enough to make it feel like Liquid Glass.
Let’s start from a common glass surface and stack inset shadows on it.

Frosted

The common glass surface: a translucent background with blur and saturation, plus a 1px highlight along the top.

.glass-button {
  background-color: oklch(100% 0 0 / 75%);
  border: 1px solid oklch(20% 0.005 85 / 8%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    /* top highlight */
    inset 0 1px 0 oklch(100% 0 0 / 70%),
    /* drop shadow */
    0 1px 2px oklch(15% 0.005 80 / 6%),
    0 8px 24px -6px oklch(15% 0.005 80 / 14%);
}
css

The background shows through hazily, but the surface itself looks flat.

Rim

Replace the top highlight with four inset shadows.

.glass-button {
  box-shadow:
    /* top-left rim light */
    inset 1px 1.5px 1px oklch(100% 0 0 / 95%),
    /* bottom-right rim light */
    inset -1px -1px 1px oklch(100% 0 0 / 70%),
    /* bottom shade for convex thickness */
    inset 0 -8px 12px -8px oklch(20% 0.005 85 / 14%),
    /* inner edge sheen */
    inset 0 0 14px -4px oklch(100% 0 0 / 70%),
    /* drop shadow */
    0 1px 2px oklch(15% 0.005 80 / 6%),
    0 8px 24px -6px oklch(15% 0.005 80 / 14%);
}
css

Light gathers along the edges and the bottom darkens slightly, so the button looks like a convex piece of glass.
Safari supports both the blur and the shadows, so it looks the same in every browser.

Floating Over a Post

In practice, a button like this floats over scrolling content. Scroll the post and compare the three surfaces.

Lorem ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Wrapping Up

Real refraction has to wait until WebKit supports SVG backdrop filters.
Until then, a few layers of shadow are a realistic compromise for getting the feel of glass on the web.

The full code is in the demo source.