01Square
02Triangle
03Circle
</> Generate code at the bottom of the settings panel. A modal opens with a <Fresnel /> snippet containing your exact values. Click Copy code.
Fresnel.tsx. Grab it from the GitHub repo and save it somewhere in your React project — typically src/components/Fresnel.tsx.
Zero runtime dependencies beyond React. No npm install step.
<div> that has a width, a height, and something visible behind it:
import Fresnel from "./Fresnel" export default function Hero() { return ( <div style={{ backgroundImage: "url('/photo.jpg')", width: 600, height: 400, }}> <div style={{ width: 280, height: 280 }}> <Fresnel shape="rectangle" bezelWidth={12} /> </div> </div> ) }The outer
div holds the content being refracted (the photo). The inner div sets the glass size — Fresnel always fills 100% × 100% of its parent.
index.html in the repo is a vanilla-JS reference, not a drop-in library.
filter, clip-path, opacity<1, mask, or mix-blend-mode creates a backdrop-root, and the glass will refract nothing instead of the real page behind it. Safe: transform, overflow, position, z-index.
There's a Framer-ready version in the repo at /framer/fresnel-framer-js.tsx — same physics, wrapped as a code component. Every setting becomes a property control in Framer's right panel.
fresnel-framer-js.tsx from the repo (button below).
Assets → Code → + → New Code Component. Name it whatever you like — Fresnel.js works.
⌘S.
Assets → Code. Drop it onto a frame that has content behind it — image, gradient, or other UI. That's what gets refracted through the glass. Tune props in the right panel.
filter, clip-path, opacity<1, mask, or mix-blend-mode. Framer's own effects panel can apply these invisibly — if the glass goes flat, that's usually why. Check the parent frame's effects.
Fresnel uses SVG backdrop-filter, a Chromium-only feature (Chrome, Edge, Brave, Arc, Opera). The component has a frosted-blur fallback for other engines; this demo does not.