Fluted Glass

Pro

Any photo seen through fluted glass, sliced into soft ribs that follow the pointer.

backgroundwebglshaderglassfluted glassimagestripesfull bleed
Fluted Glass component preview

Overview

Fluted Glass is a React and Tailwind CSS WebGL effect that shows any photo through a pane of reeded glass, in Next.js or any React app, with no dependencies. Every rib is a small cylindrical lens that squeezes a wider slice of the image, darkens at its edges, and catches a glint where it meets the next, with widths that wander like poured glass. The picture sways slowly and slides with the pointer. It caps pixel density, pauses off screen, in hidden tabs, and once settled, and reduced motion shows one frame. The image host must allow cross origin requests.

Installation

Run the following command

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

Usage

Import FlutedGlass from @/components/wensity/fluted-glass 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 { FlutedGlass } from "@/components/wensity/fluted-glass";
export default function Hero() {
return (
<FlutedGlass
className="h-[560px] w-full"
src="https://assets.wensity.com/photos/experimental-surreal/red-fabric-desert.webp"
ribs={20}
diffusion={0.7}
>
<div className="grid h-full place-items-center text-4xl font-semibold text-white">
Seen through glass
</div>
</FlutedGlass>
);
}

Props

PropTypeDefaultDescription
srcstring"https://assets.wensity.com/photos/experimental-surreal/red-fabric-desert.webp"Photograph behind the glass. Bold colour shapes read best. The host must allow cross-origin image requests.
altstring""Accessible description of the picture. Leave it empty when the backdrop is decorative.
ribsnumber20Number of ribs across the width.
diffusionnumber0.7How much the glass softens the picture, 0 keeps it sharp.
refractionnumber0.55How hard each rib bends the picture, 0 to 1.
variationnumber0.55How much the rib widths wander. 0 keeps them even.
aberrationnumber0.35Colour split at the rib edges, 0 to 1.
shadenumber0.7Darkening toward each rib edge, 0 to 1.
glintnumber0.65The thin light line where two ribs meet, 0 to 1.
parallaxnumber0.6How far the picture slides with the pointer, 0 to 1.
speednumber1Idle sway speed. 0 holds the picture still until the pointer moves.
focus[number, number][0.5, 0.5]Focal point of the picture, 0 to 1 on each axis, kept in frame when the stage crops it.
dprnumber-Render scale. Defaults to the device ratio, capped at 2.
pausedbooleanfalseFreeze on the current frame.
childrenReactNode-Content layered above the glass.

Featured in React 3D components.