Explore a unique collection of React components that embrace the aesthetics of glassmorphism and Apple's Liquid Glass effect. Designed for both desktop and mobile, this library offers adjustable glass modes and immersive interactions that push browser capabilities. Perfect for creating visually stunning UIs.
The Liquid Glass Component Library is an innovative collection of React components that delves into the realm of glassmorphism and Liquid Glass effects reminiscent of Apple's design aesthetics. This library is the result of an exploration into how closely traditional frosted glass can be replicated using React, Tailwind CSS, SVG filters, and Framer Motion.
Features
- Glass Mode: Offers classic frosted glass effects with customizable options for blur, transparency, and saturation.
- Liquid Glass Mode: An experimental refractive effect inspired by kube.io's Liquid Glass research. While Glass Mode provides practicality, Liquid Glass pushes the boundaries of what is achievable in a browser environment.
- Adaptive Themes: Supports both dark and light themes with user preference persistence.
- Dynamic Motion: Utilizes spring-driven motion animations powered by Framer Motion.
Tech Stack
This component library is built using the following technologies:
- React 19 + TypeScript 5.9
- Vite 7
- Tailwind CSS 4.1
- Framer Motion
- lucide-react
Component Overview
The library comprises over 70 components categorized as follows:
| Category | Examples |
|---|---|
| Theme & Glass Primitives | ThemeProvider, useTheme, useGlassSurface, GlassTopHighlight, GlassSheen |
| Inputs, Toggles & Pickers | LiquidGlassInput, LiquidGlassSelect, LiquidGlassToggle, LiquidGlassSlider, LiquidGlassCheckbox, LiquidGlassRadioGroup, LiquidGlassColorPicker, LiquidGlassFileUpload |
| Buttons & FABs | LiquidGlassButton, LiquidGlassIos26Button, MobileFloatingActionButton |
| Layout & Surfaces | LiquidGlassCard, LiquidGlassFluidCard, LiquidGlassResizable, LiquidGlassScrollArea, LiquidGlassKanban, LiquidGlassDock |
| Navigation | LiquidGlassNavigation, LiquidGlassBreadcrumb, LiquidGlassMenubar, LiquidGlassTabBar, MobileBottomTabBar, MobileTopNavBar, MobileSlideMenu |
| Overlays, Menus & Tooltips | LiquidGlassTooltip, LiquidGlassHoverCard, LiquidGlassContextMenu, LiquidGlassNotificationDropdown, MobileContextPreview |
| Modals, Drawers & Sheets | LiquidGlassModal, LiquidGlassDrawer, LiquidGlassSheet, LiquidGlassCommandPalette, MobileActionSheet, MobileAlertDialog, MobilePermissionDialog |
| Feedback & Status | LiquidGlassAlert, LiquidGlassBadge, LiquidGlassToast, LiquidGlassProgress, LiquidGlassSkeleton, LiquidGlassEmptyState, MobileSnackbar, MobileAppRating, MobileSplashScreen |
| Data Display | LiquidGlassTable, LiquidGlassPagination, LiquidGlassTimeline, LiquidGlassCalendar, LiquidGlassStatCard, LiquidGlassRating, LiquidGlassStepper |
| Media & Content | LiquidGlassCarousel, LiquidGlassMusicPlayer, LiquidGlassWeatherWidget |
Glass System Configuration
The library offers flexible controls for adjusting glass properties in two modes:
Glass Mode
| Slider | CSS variable | Default | Effect |
|---|---|---|---|
| Blur | --lg-blur | 17 | Backdrop-filter blur strength |
| Transparency | --lg-transparency | 10 | Surface and border opacity |
| Saturation | --lg-saturation | 100 | Backdrop-filter saturation |
Liquid Glass Mode
| Control | Default | Effect |
|---|---|---|
| Profile | convex-circle | Refractive surface shape |
| Bezel | 9 | Edge curvature size |
| Refraction | 90 | Distortion amount |
| Thickness | 120 | Virtual glass thickness |
| Light angle | -150 | Specular light direction |
| Specular | 10 | Highlight intensity |
| Transparency | 20 | Surface opacity |
| Blur | 10 | Base blur |
| Saturation | 100 | Color saturation |
Usage Example
To implement a component from the library:
import { LiquidGlassButton, LiquidGlassCard, LiquidGlassModal } from "liquid-glass";
function App() {
const [open, setOpen] = useState(false);
return (
<LiquidGlassCard className="p-6">
<h2 className="text-xl font-semibold text-[var(--lg-text)]">Hello Glass</h2>
<LiquidGlassButton onClick={() => setOpen(true)}>Open modal</LiquidGlassButton>
<LiquidGlassModal open={open} onClose={() => setOpen(false)} title="Demo">
This surface adapts to your glass settings automatically.
</LiquidGlassModal>
</LiquidGlassCard>
);
}
Additional Information
While this repository is primarily a personal endeavor focused on experimentation and learning, it is envisioned as a potential foundation for a more robust glass UI library in the future, inspired by existing projects from notable sources like Shadcn UI and Ionic.
No comments yet.
Sign in to be the first to comment.