Skip to content

Liquid Glass UI for React

A Liquid Glass effect for React in the style of Apple's iOS 26 design: a lens that refracts the page behind it through an SVG displacement map, with a specular rim.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/liquid-glass.json
  • LiquidGlass
  • supportsLiquidGlass
  • MAX_REFRACTION_SURFACES
  • +1 more

In this browser:Frosted fallback

Drag the lens

A clear circle lens over crisp artwork. Drag it (or focus it and use the arrow keys) and watch the lines bend and split into color at the rim.

Files to copy

4 folders · 4 files · 3 packages
From theme/src/
  • components/liquid-glass/
  • hooks/{use-intersection.ts, use-media-query.ts, use-preferences.ts}
  • lib/cn.ts
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/liquid-glass.jsonRegistry item: liquid-glass. The styles need the Tailwind v4 glass UI setup.
Packages
pnpm add @base-ui/react clsx tailwind-merge

Floating tab bar

A pill of regular liquid glass over scrolling content, the way iOS 26 floats its tab bars. Its tint thins out towards the rim, so the tiles visibly bend at the edge while the labels keep a solid backplate.

  • Golden hour
  • Deep sea
  • Lagoon
  • Bloom
  • Ember
  • Canopy
  • Dusk
  • Citrus
  • Golden hour
  • Deep sea
  • Lagoon
  • Bloom
  • Ember
  • Canopy
  • Dusk
  • Citrus

Shapes and variants

Pill, circle and rounded rectangle, each with its own displacement map. Interactive glass grows a touch on hover and presses in on tap: only its scale ever animates.

Now playing

Glass Animals · Heat Waves

Props

PropTypeDefaultDescription
shape"circle" | "rect" | "pill""rect"Outline of the lens. "rect" uses the element's own border radius (rounded-sheen-xl by default, override with className); "pill" and "circle" are fully rounded.
variant"regular" | "clear""regular""regular": frosted and tinted, for text and controls (legible on anything). "clear": barely tinted, most see-through. For icons and bold labels over media.
refractionnumber1How strongly the rim bends the backdrop. 0 = flat glass, 1 = default, up to 2.
bezelnumbermost of the corner radius (capped at 40)Sets the width of the curved rim in px.
frostnumber12 (regular) or 1 (clear)Sets the frost inside the lens, in px.
saturationnumber1.5Colour boost of the backdrop seen through the lens (1 = none).
aberrationnumber0Splits the refracted edge into its colours, like a prism (0 to 1).
specularbooleantrueAdds a bright specular rim along the edge.
interactivebooleanfalseGrows slightly on hover and presses in on tap (scale only; none with reduced motion).
renderReactElement | function<div />Render as another element: a button, a nav, a motion.div…

Keyboard

KeysAction
TabNot focusable: LiquidGlass is decoration. Give it role, tabIndex and handlers when it is a control; interactive adds a solid focus ring.

Accessibility

  • Pure decoration around your content: text on a regular lens keeps 4.5:1 contrast on any backdrop, and the rim is decorative.
  • The lens is Chromium only: Safari and Firefox keep the frosted blur. Reduced transparency, more contrast and forced colors give a solid surface; forced colors drop the rim.
  • A draggable lens needs a keyboard alternative: the example moves with the arrow keys (Shift for bigger steps).

All exports on this page

  • LiquidGlass — Liquid glass: a lens that bends the page behind it, like Apple's Liquid Glass.
  • MAX_REFRACTION_SURFACES — Refraction budget: SVG refraction on at most MAX_REFRACTION_SURFACES lenses at once, page-wide.
  • supportsLiquidGlass — Whether this browser renders SVG filters in backdrop-filter (backdrop-filter: url(#id)).

When to use the liquid glass effect

  • Use it as a liquid glass effect for a few hero surfaces that sit over photos or video, such as a floating media control, a caption overlay or a navigation pill that visibly bends the page behind it in Chromium.
  • Use shape="pill" for a floating action bar and shape="circle" for a round play button, with variant="clear" when the content is only an icon or a bold label over imagery.
  • Add interactive when the lens is a control, so it grows slightly on hover and presses in on tap, and give it role, tabIndex and handlers yourself.
  • Skip it when you have more than a handful of surfaces or ordinary cards: refraction is limited to three lenses per page, so GlassCard is the right tool for lists, grids and panels.
  • Pair it with Button for the action inside the lens, GlassCard for everything else on the page, and the supportsLiquidGlass helper when you want to adjust copy or layout by engine.

Frequently asked questions

19 effects pages in all: browse them on All effects.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .