From r/vibecoding? 🫡 Get 35% off Wensity UI Lifetime with

Refraction Glass Container

Pro

Real refraction, where feDisplacementMap warps the actual pixels sitting behind the card instead of blurring them.

css 3d3dglassrefractioncontainerdepthblur
Refraction Glass Container component preview

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add refraction-glass-container

Usage

Import RefractionGlassContainer from @/components/wensity/refraction-glass-container and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import { RefractionGlassContainer } from "@/components/wensity/refraction-glass-container";
export default function Example() {
return (
<RefractionGlassContainer width={420} minHeight={260} distortion={14} blur={14}>
<div className="font-display text-xl font-bold">Bent light, not blur.</div>
<p className="mt-2 text-sm opacity-80">
SVG feDisplacementMap warps every pixel behind this card.
</p>
</RefractionGlassContainer>
);
}

Props

PropTypeDefaultDescription
childrenReact.ReactNode-Content rendered inside the glass card.
widthnumber | string380Card width.
minHeightnumber220Card minimum height.
distortionnumber14Strength of the refraction warp in pixels.
blurnumber14Backdrop blur strength in pixels.
paddingnumber | string24Inner padding.
showBlobsbooleantrueRender the animated blobs behind the glass.
blobColors[string, string, string]-Override blob colours.
backgroundstring-Background tint behind blobs.