DEV Community

Cover image for Liquid Glass Web Component: Vanilla JS Glass Morphism Effect
jQueryScript
jQueryScript

Posted on

Liquid Glass Web Component: Vanilla JS Glass Morphism Effect

Liquid Glass Web Component: a Vanilla JavaScript library that creates realistic glass morphism effects using SVG displacement filters.

Key features:

  • Works in any framework (React, Vue, Angular, or vanilla)
  • Automatic browser detection with graceful fallback
  • Interactive depth changes on click
  • Auto-sizing and responsive modes
  • Zero dependencies

The component uses SVG displacement maps to distort the backdrop.

It works best in Chromium browsers but degrades cleanly in Firefox and Safari.

Just include two small JavaScript files and use the custom element in your markup.

๐Ÿ‘‰ Blog Post

๐Ÿ‘‰ GitHub Repo

๐Ÿ‘‰ Live Demo

Top comments (0)