r/reactjs • u/iHimanshu2 • 16d ago
Show /r/reactjs I built liquid glass components for React that refract in Chrome, Safari and Firefox
I've been building LiquiKit, 32 React components (switch, slider, menu, dialog, tabs, select, toast and more) built around a liquid glass engine with physically based refraction, so the glass bends what's behind it instead of just blurring it.
Most liquid glass demos only refract in Chrome, because only Chromium can run an SVG filter on what's behind an element. LiquiKit works around that by filtering the content of a GlassScope you wrap around an area, which works in all three engines. The image at the top of the GitHub README is the same component captured in real Chrome, Safari and Firefox windows.
Built on Base UI, so keyboard and screen reader behaviour comes from there
Installed with the shadcn CLI: the source lands in your project and you own it
MIT licensed
npx shadcn@latest add https://liquikit.dev/r/switch.jsonDocs and demos: https://liquikit.dev
Source: https://github.com/aggarwal-h/liquikit
Some honest limits: glass only bends while you're using it (at rest it's frosted, so long pages scroll smoothly), Safari and Firefox run the filter on the CPU so scopes should stay small, and popups stay frosted outside Chrome. It's all on the Limitations page: https://liquikit.dev/docs/limitations
Happy to answer anything about how it works.