๐ซง Pixel-perfect recreation of Apple's iOS 26 Liquid Glass effect using only CSS and SVG filters. Includes LiquidGlass containers, LiquidText, and LiquidButton components.
๐ซง Liquid Glass
iOS 26 Liquid Glass effect recreated for the web using pure CSS SVG filters.

โจ Features
- ๐จ Pure CSS SVG Filters - Displacement mapping with backdrop-filter
- ๐ฎ Realistic Refraction - Dynamic displacement creates authentic glass distortion
- ๐ Chromatic Aberration - RGB color splitting for that premium glass look
- โก Performant - GPU-accelerated CSS transforms and filters
- ๐ฑ Responsive - Auto-sizing components that scale beautifully
- ๐ Safari Fallback - Automatic graceful degradation with glassmorphism mode
- ๐ฌ Animated Backgrounds - Optional spinning background images with hover control
๐งฉ Components
LiquidGlass
A versatile container with liquid glass refraction effect. Can be used for cards, panels, hero sections, inline elements, and buttons.
<!-- Basic glass panel -->
<LiquidGlass class="rounded-[50px]" blur={0} chromaticAberration={2}>
<div class="p-8 text-4xl font-bold text-white">
Your content here
</div>
</LiquidGlass>
<!-- Glass with animated background --> <LiquidGlass class="rounded-[50px]" background="/assets/chrome1.png" blur={0} chromaticAberration={2} > <div class="p-8 text-6xl font-black text-white"> Animated Background </div> </LiquidGlass>
<!-- Button style --> <LiquidGlass class="rounded-[30px]" color="black" chromaticAberration={2} button> <a href="/link" class="px-8 py-4 text-xl text-white">Click Me</a> </LiquidGlass>
<!-- Inline usage --> <p> This is an <LiquidGlass class="rounded-full" chromaticAberration={2} button inline> <span class="px-2 py-0.5 text-sm text-white">inline glass</span> </LiquidGlass> element. </p>
| Prop | Type | Default | Description | |------|------|---------|-------------| | class | string | โ | CSS classes (use for border-radius, etc.) | | depth | number | 10 | Edge refraction depth | | strength | number | 100 | Displacement filter strength | | blur | number | 0 | Blur amount | | chromaticAberration | number | 0 | RGB split intensity | | color | 'black' \| 'white' | โ | Glass tint color | | background | string | โ | Background image URL (enables spinning animation) | | freeze | true | โ | Disable background spin animation | | noMorph | true | โ | Disable Safari glassmorphism fallback | | button | true | โ | Enable button styling with hover effects | | inline | true | โ | Render as inline element (span) |
๐ Quick Start
# Clone the repository
git clone https://github.com/nikdelvin/liquid-glass.git
Install dependencies
npm install
Start development server
npm run dev
๐ Browser Support
| Browser | Support | |---------|---------| | Chrome 76+ | โ Full | | Firefox 103+ | โ Full | | Safari 15+ | โ ๏ธ Partial (auto-fallback to glassmorphism) | | Edge 79+ | โ Full |
Safari automatically falls back to a blurred glassmorphism effect when backdrop-filter: url() is not supported.
๐ Project Assets
Background images and textures in /public/assets/:
public/
โโโ assets/
โโโ background.webp # Default background
โโโ chrome1.png, chrome2.png, chrome3.png
โโโ rocks1.png, rocks2.png, rocks3.png
โโโ silk1.png, silk2.png, silk3.png
โโโ lines1.svg, lines2.svg, lines3.svg
โโโ displacement-map-*.png # Displacement textures
โโโ specular-map-*.png # Specular textures
๐ ๏ธ Tech Stack
- Astro - Static site generator
- Tailwind CSS - Utility-first CSS
- Anime.js - Animation library for background effects
- SVG Filters - feDisplacementMap, feGaussianBlur, feColorMatrix
- CSS backdrop-filter
๐ License
MIT ยฉ Nik Delvin
Made with ๐ซง by Nik Delvin