Liquid 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 cards for React that bend what's behind them like a real lens. The rim refracts and splits light into a thin rainbow, a highlight turns to follow the cursor, and the glass squishes when pressed. It's one TypeScript file with Tailwind CSS and Motion, ready to drop over any photo or gradient.
Customize
Usage
import { LiquidGlassCard } from "@/components/motionkit/liquid-glass-card";
{/* clear glass shows what is behind it: place it over an image, pattern or background effect */}
<LiquidGlassCard className="w-72">
<h3>Glass, light and depth</h3>
<p>Hover me.</p>
</LiquidGlassCard>Motion
The exact curves this component runs, plotted with Motion's own maths.
Lift and shadow
Pointer enters the card
Content parallax
Pointer moves over the card
Light sweep
Pointer enters the card
Rim highlight
Pointer moves over the card
Press squish
Card pressed
Cards over a photo, gradient or video background, such as a hero with floating stats, a music player or a settings panel. The glass only shines when there is something behind it to bend.
A canvas draws a displacement map the size of the card: near the rounded edge every pixel is pushed outward along the edge's normal, following a lens-shaped curve, and the middle stays put. An SVG filter applies that map to the backdrop three times, once per colour channel at slightly different strengths, which splits light into a thin rainbow fringe at the rim. Layered inset shadows give the glass thickness, a conic highlight turns to face the pointer, and a spring squish answers a press.
| Prop | Type | Default | Description |
|---|---|---|---|
| refraction | number | 0.5 | 0–1. How strongly the rim bends what is behind it. Chrome and Edge only; other browsers show clear glass. |
| dispersion | number | 0.4 | 0–1. Rainbow fringing where the rim bends light, like a real lens. Needs refraction. |
| blur | number | 0 | Backdrop blur in pixels. 0 keeps the glass perfectly clear. |
| parallax | number | 4 | How far the content drifts toward the pointer, in pixels. 0 keeps it still. |
| glow | string | "#5FAEB4" | Colour of the luminous border and reflection glow. |
| children | ReactNode | — | Card content. |
How we audit: the WCAG 2.2 animation checklist and respecting reduced motion in React.
Yes. The file starts with "use client", so you can import it straight into a Server Component page or layout. It works in Vite as is, and in Astro as a React island.
Only the motion package, beside React and Tailwind CSS v4. There is no MotionKit package and no Tailwind config to add.
Yes, with MotionKit Plus. Add the @motionkit registry and your personal token to components.json (the snippet is on your account page), then run npx shadcn@latest add @motionkit/liquid-glass-cards. It saves the file to components/motionkit and installs its dependencies.
Liquid Glass Cards is part of MotionKit Plus (£12 / $15 / €14 a month or £96 / $120 / €112 a year). The live preview and playground are free to explore; Plus unlocks its source code, every customisation control and commercial use.
With reduced motion on, the card does not lift, drift, sweep or squish, and the rim highlight stays still. The glow fades in place.
The refraction uses an SVG filter as a backdrop-filter, which only Chromium browsers support so far. Other browsers drop that one layer and show clear glass with the same rim, highlights and motion.
This component draws a displacement map for the card's rounded edge on a canvas and applies it to the backdrop with an SVG filter, once per colour channel, so the rim bends and splits light. Inset shadows give the glass thickness and a conic gradient makes the highlight. The guide to the liquid glass effect walks through it step by step.
Clear glass only shows when there's something behind it to bend. Put the cards over a photo, gradient or video. If text over a busy background gets hard to read, raise the blur prop a little.
Liquid 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.
A 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.
A card with a soft glow that tracks the pointer across its surface.
Now playing
Glass, light and depth
The live preview is free to explore. Plus unlocks the source for Liquid Glass Cards and every other premium component.
Not ready for Plus? A free account unlocks 4 premium components, Depth Card, Rolling Text, Dot Wave and Confetti Button, with no card needed.
Customize
Usage
import { LiquidGlassCard } from "@/components/motionkit/liquid-glass-card";
{/* clear glass shows what is behind it: place it over an image, pattern or background effect */}
<LiquidGlassCard className="w-72">
<h3>Glass, light and depth</h3>
<p>Hover me.</p>
</LiquidGlassCard>Motion
The exact curves this component runs, plotted with Motion's own maths.
Lift and shadow
Pointer enters the card
Content parallax
Pointer moves over the card
Light sweep
Pointer enters the card
Rim highlight
Pointer moves over the card
Press squish
Card pressed
Now playing
Glass, light and depth