motionkit.byHizmedia (opens hizmedia.com in a new tab)
ComponentsTheme StudioPage BuilderPricing

Start building with motion.

206 animated React components, free to browse and customise. Plus unlocks every premium one, with a 14-day free trial.

Browse componentsSee Plus
motionkit.

Animated React components for people who love the details. Built with TypeScript, Tailwind CSS and Motion.

  • Hizmedia on Instagram (opens in a new tab)
  • Hizmedia on LinkedIn (opens in a new tab)
  • Hizmedia on YouTube (opens in a new tab)

Product

  • Components
  • Theme Studio
  • Page Builder
  • MotionKit Plus
  • What's new

Components

  • Backgrounds
  • Text effects
  • Buttons
  • Cards
  • Sections
  • All 206 components

Resources

  • Guides
  • Free tools
  • Free components
  • For shadcn/ui
  • Liquid glass
  • Hero sections

Company

  • About
  • Cookie policy
  • Your account
  • Hizmedia (opens in a new tab)
  • Start a project

motionkit.

© 2026 Hizmedia (opens hizmedia.com in a new tab)· Designed and built in the UK

RSS Back to top
    1. Guides
    2. Effects

    How to Make a Liquid Glass Effect in React

    Build a liquid glass panel in React: a backdrop blur, inner shadows for thickness, a rim of light that follows the pointer, and text that stays readable.

    HHizmediaUpdated 10 November 20267 min read
    On this page
    1. 01Frosted glass and liquid glass
    2. 02Start with the backdrop
    3. 03Give it thickness
    4. 04A rim that catches the light
    5. 05A sheen and a little parallax
    6. 06Why not an SVG displacement filter?
    7. 07Keep the text readable
    8. 08Keep it fast

    Liquid glass is frosted glass with a sense of material: it has thickness, its edges catch the light, and it moves like something you could pick up. You can build it in React with CSS you already know, plus a little Motion for the parts that follow the pointer. This guide takes apart MotionKit's Liquid Glass Panel layer by layer, and covers the details that keep it readable and fast.

    01Frosted glass and liquid glass#

    Glassmorphism, the trend from a few years ago, is mostly a blurred, semi-transparent background. Liquid glass adds three things on top: a sense of depth from light and shadow inside the edges, a bright rim that turns to face the light, and motion that gives the surface weight. None of them needs WebGL. They are layers of gradients, shadows and masks stacked inside one rounded box.

    02Start with the backdrop#

    The glass itself is backdrop-filter, which filters whatever sits behind the element. A little blur softens the background, extra saturation keeps its colours rich through the glass, and a touch of brightness lifts it so it reads as a lighter material. Keep the Safari prefix: it still needs -webkit-backdrop-filter.

    example.tsx
    const glass = "blur(1.5px) saturate(160%) brightness(1.08)";
    
    <div className="relative isolate overflow-hidden rounded-[28px]"
      style={{ background: "linear-gradient(145deg, rgb(255 255 255 / 0.3), rgb(255 255 255 / 0.14) 48%, rgb(159 216 220 / 0.17))" }}>
      <div aria-hidden className="absolute inset-0 -z-10"
        style={{ borderRadius: "inherit", backdropFilter: glass, WebkitBackdropFilter: glass }} />
      {children}
    </div>

    Less blur than you'd expect looks more like glass. Heavy blur turns it into frosted plastic; a pixel or two lets the shapes behind it show through while still separating them from the content on top.

    03Give it thickness#

    Real glass is bright along its top edge and slightly darker at the bottom, where light leaves it. Stacked inset shadows fake that: a thin bright line at the top, a faint one at the bottom, a hairline all round, and two soft washes for the body.

    example.tsx
    box-shadow:
      inset 0 1px 1px rgb(255 255 255 / 0.55),
      inset 0 -1px 1px rgb(255 255 255 / 0.15),
      inset 0 0 0 1px rgb(255 255 255 / 0.14),
      inset 0 -18px 30px -18px rgb(0 0 0 / 0.12),
      inset 0 16px 26px -20px rgb(255 255 255 / 0.4);

    04A rim that catches the light#

    The detail that sells it is the rim: a thin ring that is brightest on the side facing the light. Draw it with a conic gradient on an element the same size as the glass, then mask away everything but a 1.5px border. Turning the gradient's starting angle towards the pointer makes the highlight follow it around the edge.

    example.tsx
    const angle = useTransform(() => Math.atan2(y.get() - 0.5, x.get() - 0.5) * 180 / Math.PI + 90);
    const rim = useMotionTemplate`conic-gradient(from ${useTransform(angle, (a) => a - 60)}deg,
      transparent, rgb(255 255 255 / 0.95) 60deg, transparent 120deg,
      transparent 180deg, rgb(255 255 255 / 0.35) 240deg, transparent 300deg)`;
    
    <motion.div aria-hidden className="pointer-events-none absolute inset-0" style={{
      borderRadius: "inherit", padding: 1.5, background: rim,
      WebkitMask: "linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",
      WebkitMaskComposite: "xor", maskComposite: "exclude",
    }} />

    Here x and y are the pointer's position across the glass from 0 to 1, passed through springs so the light glides rather than jumps. A second, softer highlight a half turn away reads as light reflected from the far side.

    05A sheen and a little parallax#

    Two more touches make it feel liquid. A broad radial gradient centred on the pointer brightens the glass where the light is. And moving the content a few pixels against the pointer gives a sense that it sits inside the glass rather than printed on it.

    • Keep the sheen subtle: white at about 20% opacity, fading out within half the panel.
    • Limit the parallax to about 5px each way, or text starts to feel loose.
    • Reset both to a resting position when the pointer leaves, so the glass looks lit from above by default.

    06Why not an SVG displacement filter?#

    Real refraction, where the background bends at the edges, is usually done with an SVG feDisplacementMap applied through backdrop-filter: url(#filter). It looks wonderful in screenshots, but only Chromium browsers apply SVG filters as a backdrop, and while the element is being transformed or animated it can flash opaque. For a panel people drag and squash, a native blur is the stable choice.

    If you want true refraction, do it where you control the pixels: render the background in WebGL and bend it in a shader. MotionKit's Glass Ribbons, Glass Blobs and Glass Form work that way.

    07Keep the text readable#

    Glass is only useful if what's on it can be read. Check contrast against the brightest part of the background that can pass behind the panel, not an average, and raise the panel's tint until body text clears 4.5:1 there. Then respect people's settings: with reduced motion, drop the squash, the parallax and the moving highlight and keep the still glass; and where browsers support prefers-reduced-transparency, swap the backdrop for a solid tinted fill.

    example.tsx
    @media (prefers-reduced-transparency: reduce) {
      .glass { backdrop-filter: none; background: rgb(28 34 40 / 0.94); }
    }

    08Keep it fast#

    • A backdrop filter redraws whenever what's behind it changes, so a few panels over a moving background is fine and dozens is not.
    • Animate transforms and opacity, never the blur radius itself.
    • Keep shadows and the caustic glow outside the element with the backdrop filter, so they don't enlarge the area being filtered.
    • Let springs settle: once the pointer leaves, nothing should keep animating.

    Put it into practice

    Components from this guide

    • Liquid Glass PanelPlusLiquid glass you can hold: a domed lens that magnifies and bends the backdrop with a rainbow rim, squashing like jelly as you drag it and casting focused light into its shadow.
    • Liquid Glass CardsPlusCrystal-clear glass cards with lens-like edges, rainbow dispersion, a rim highlight that tracks the pointer and a liquid press.
    • Glass LensPlusA disc of liquid glass that glides after the cursor, enlarging whatever is beneath it, with a rainbow rim and a highlight rolling across the dome.
    • Glass RibbonsPlusRibbons of iridescent glass drifting through the dark, twisting to bright edges side-on and blooming with colour face-on, like light on a soap film.
    • Holographic CardPlusA metallic rainbow foil that shifts and shimmers as the pointer moves, like a holographic trading card.
    See all 19 liquid glass components
    PreviousStagger Animations in React with MotionNext Animated Hero Sections in Next.js That Stay Fast

    On this page

    1. Frosted glass and liquid glass
    2. Start with the backdrop
    3. Give it thickness
    4. A rim that catches the light
    5. A sheen and a little parallax
    6. Why not an SVG displacement filter?
    7. Keep the text readable
    8. Keep it fast

    Found this useful? Send it to someone building with motion.

    Keep reading

    All guides
    • Effects·7 min read

      WebGL Shader Backgrounds in React, Without three.js

      Render an animated shader background in React with plain WebGL: one triangle, a fragment shader, time and pointer uniforms, and the performance details.

      Read guide
    • Build it·8 min read

      Page Transitions in the Next.js App Router with View Transitions

      Animate between pages in the Next.js App Router with React's ViewTransition: shared element morphs, directional slides, a fixed header and reduced motion, plus when Motion still helps.

      Read guide
    • Fundamentals·7 min read

      Custom Animations in Tailwind CSS v4: Keyframes, Easing and Enter Effects

      Add custom animations in Tailwind CSS v4 with @theme: keyframes, animate-* classes, custom easing curves, enter animations with starting:, reduced motion, and when to switch to Motion.

      Read guide