A premium React UI library with Apple-inspired glass surfaces. Features true glassmorphism with translucent backgrounds, blur effects, and smooth animations.
npm install apple-liquid-glass-uiA premium React UI library with Apple-inspired glass surfaces. Features true glassmorphism with translucent backgrounds, blur effects, and smooth animations.
Perfect for creating modern, elegant UIs with authentic macOS/iOS feel.
š View Live Demo | š¦ npm | š GitHub
- True Glassmorphism: Translucent backgrounds with backdrop blur and saturation filters
- Apple-Inspired Design: Authentic macOS/iOS aesthetic with refined typography and spacing
- Dual API: Use as React components or standalone CSS classnames
- Dark Mode Support: Seamless light/dark theme switching
- Mobile-First: Touch-friendly with responsive breakpoints
- 27+ Components: Complete UI toolkit from buttons to navigation
- TypeScript: Full type definitions included
- Tree-Shakeable: Import only what you need
- Zero Runtime: No CSS-in-JS overhead - just static CSS
Apple Liquid Glass UI is built for speed. Unlike traditional CSS-in-JS libraries, we use zero runtime CSS for maximum performance.
| Library | Full Bundle (gzipped) | vs Glass UI |
|---------|----------------------|-------------|
| Apple Liquid Glass UI | 24.1 KB | baseline |
| Material-UI (MUI) | 95.0 KB | +293% |
| Chakra UI | 85.0 KB | +252% |
| Ant Design | 180.0 KB | +645% |
| Mantine | 75.0 KB | +211% |
Key Metrics:
- š¦ 24.1 KB total (gzipped) - JavaScript + CSS combined
- šÆ 6.6 KB JavaScript (gzipped)
- šØ 10.9 KB CSS (gzipped)
- ā”ļø 72% smaller than Chakra UI
- š 75% smaller than Material-UI
Traditional CSS-in-JS libraries (styled-components, emotion, etc.) have runtime overhead:
- ā Parse style objects on every render
- ā Generate class names dynamically
- ā Inject styles into the DOM
- ā Additional ~30KB bundle size
Apple Liquid Glass UI uses static CSS:
- ā
Zero runtime overhead
- ā
Styles loaded once, cached forever
- ā
No style computation during renders
- ā
Maximum performance
Import only what you need. Each component adds minimal weight:
| Component | Size (with CSS) |
|-----------|----------------|
| Button | 3.9 KB |
| Input | 4.7 KB |
| Badge | 2.5 KB |
| Avatar | 3.3 KB |
| Card | 4.8 KB |
| DatePicker | 14.5 KB |
Average component size: ~5.1 KB (uncompressed source)
Run the benchmark yourself:
``bash`
npm run benchmarkor open scripts/benchmark.html in your browser
Typical results (1000 components):
- 30-40% faster initial mount vs CSS-in-JS
- 25-35% faster updates vs CSS-in-JS
- 0KB runtime vs ~30KB for styled-components
For a typical application using 10-15 components:
- Glass UI: ~15-20 KB total
- MUI/Chakra: ~100 KB total
- You save: ~80 KB (4-5x smaller bundle)
Result: Faster page loads, better Core Web Vitals, improved user experience.
`bash`
npm install apple-liquid-glass-ui
Import the CSS tokens and utilities in your app entry point:
`tsx`
import 'apple-liquid-glass-ui/dist/index.css';
Set the theme attribute on your HTML element:
`html`
Add a colorful background to see the glass effect:
`tsx
import { Button, Card } from 'apple-liquid-glass-ui';
function App() {
return (
Dual API
apple-liquid-glass-ui supports both React components and classname utilities.
$3
`tsx
import { Button } from 'apple-liquid-glass-ui';
`$3
`html
`Both approaches provide the same authentic Apple Glass styling with blur effects, translucency, and smooth animations.
Components
$3
`tsx
import { Button } from 'glass-ui';
// Icon button
`Classname API:
`html
`$3
`tsx
import { Input, Textarea, InputGroup } from 'glass-ui';
label="Email"
hint="We'll never share your email"
error="Invalid email"
required
>
`Classname API:
`html
Invalid email
`$3
`tsx
import { Card, CardHeader, CardBody, CardFooter } from 'glass-ui';
Content goes here
`Classname API:
`html
Card Title
Card description
Content goes here
`$3
`tsx
import { Sheet } from 'glass-ui';const [open, setOpen] = useState(false);
setOpen(false)} size="md">
setOpen(false)} />
Content goes here
`$3
`tsx
import { Select, Dropdown } from 'glass-ui';// Native select
// Custom dropdown
options={[
{ value: '1', label: 'Option 1' },
{ value: '2', label: 'Option 2' },
]}
value={value}
onChange={setValue}
size="md"
/>
`$3
`tsx
import { Checkbox, Radio, Switch } from 'glass-ui';
`Classname API:
`html
`$3
Glass-styled calendar date picker with animations:
`tsx
import { DatePicker } from 'apple-liquid-glass-ui';const [date, setDate] = useState();
// Basic date picker
label="Select Date"
placeholder="Choose a date"
value={date}
onChange={setDate}
size="md"
/>
// With constraints
label="Birth Date"
placeholder="MM/DD/YYYY"
value={birthDate}
onChange={setBirthDate}
maxDate={new Date()}
size="md"
/>
// Different sizes
`Props:
-
value: Selected date (Date object)
- onChange: Callback with selected date
- label: Optional label text
- placeholder: Input placeholder
- minDate: Minimum selectable date
- maxDate: Maximum selectable date
- disabled: Disable picker
- size: 'sm' | 'md' | 'lg'Features:
- Full calendar view with month/year navigation
- Today button for quick access
- Min/max date constraints
- Glass-styled dropdown with blur effects
- Smooth animations
- Dark mode support
$3
`tsx
import { Badge } from 'glass-ui';New
Success
`$3
`tsx
import { Avatar, AvatarGroup } from 'glass-ui';
`$3
`tsx
import { Heading, Text, Code, Link } from 'glass-ui';Main Heading
Paragraph text
const foo = 'bar';
Learn more
`Classname API:
`html
Main Heading
Paragraph text
const foo = 'bar';
Learn more
`$3
`tsx
import { Tooltip } from 'glass-ui';
`$3
`tsx
import { Container, Stack, Grid, Flex, Divider, Spacer, Center } from 'apple-liquid-glass-ui';
Item 1
Item 2
Grid item 1
Grid item 2
Grid item 3
// Flex - Flexible layouts with props
Item 1
Item 2
Item 3
`Flex Props:
-
direction: 'row' | 'column' | 'row-reverse' | 'column-reverse'
- align: 'start' | 'center' | 'end' | 'stretch' | 'baseline'
- justify: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'
- wrap: 'nowrap' | 'wrap' | 'wrap-reverse'
- gap: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
- inline: Display as inline-flexClassname API:
`html
Item 1
Item 2
Grid item 1
Grid item 2
Grid item 3
Item 1
Item 2
`$3
Display important messages with glass-styled alerts:
`tsx
import { Alert } from 'apple-liquid-glass-ui'; variant="success"
title="Success!"
message="Your changes have been saved."
closable
/>
variant="error"
title="Error"
message="Something went wrong."
/>
variant="warning"
title="Warning"
message="Please review before proceeding."
/>
Simple info alert without title
`Props:
-
variant: 'default' | 'success' | 'error' | 'warning' | 'info'
- title: Optional alert title
- message: Alert message content
- closable: Show close button
- onClose: Callback when closed$3
Apple-style navigation with glass blur effect:
`tsx
import { GlassTopNav, GlassNavItem, GlassBottomNav } from 'apple-liquid-glass-ui';// Top Navigation
MyApp
setActive('home')}>
Home
setActive('about')}>
About
setActive('contact')}>
Contact
// Bottom Navigation (shows on mobile <768px)
`Features:
- Sticky top navigation with blur background
- Mobile bottom navigation that appears on small screens
- Active state styling with accent color
- Compound component pattern for flexible layouts
$3
Range input with glass styling and optional value display:
`tsx
import { Slider } from 'apple-liquid-glass-ui';const [volume, setVolume] = useState(50);
label="Volume"
value={volume}
onChange={setVolume}
min={0}
max={100}
showValue
size="md"
/>
label="Temperature"
value={temp}
onChange={setTemp}
min={-20}
max={40}
step={0.5}
showValue
unit="°C"
/>
`Props:
-
label: Optional label text
- value: Current value
- onChange: Callback with new value
- min, max, step: Range configuration
- showValue: Display current value
- unit: Optional unit suffix
- size: 'sm' | 'md' | 'lg'$3
Content organization with default or underline variants:
`tsx
import { Tabs } from 'apple-liquid-glass-ui'; items={[
{ key: 'overview', label: 'Overview', content:
Overview content },
{ key: 'details', label: 'Details', content: Details content },
{ key: 'settings', label: 'Settings', content: Settings content }
]}
defaultActiveKey="overview"
onChange={(key) => console.log('Tab changed:', key)}
/>// Underline variant
variant="underline"
items={[...]}
/>
`Props:
-
items: Array of { key, label, content }
- defaultActiveKey: Initial active tab
- onChange: Callback when tab changes
- variant: 'default' | 'underline'$3
Progress indicators with optional percentage display:
`tsx
import { Progress } from 'apple-liquid-glass-ui';// Determinate progress
// Indeterminate (loading)
// With label
value={75}
showPercent
label="Upload Progress"
size="lg"
/>
// Variants
`Props:
-
value: Progress value (0-100)
- indeterminate: Show loading animation
- showPercent: Display percentage text
- label: Optional label above progress bar
- variant: 'default' | 'success' | 'error' | 'warning'
- size: 'sm' | 'md' | 'lg'$3
Loading indicators with optional overlay mode:
`tsx
import { Spinner } from 'apple-liquid-glass-ui';// Basic spinner
// With label
// Full-page overlay
// Different sizes
`Props:
-
size: 'sm' | 'md' | 'lg'
- label: Optional loading text
- overlay: Full-page overlay mode with glass background$3
Bootstrap-style loading placeholders with smooth animations:
`tsx
import { Skeleton, SkeletonText, SkeletonAvatar, SkeletonCard, SkeletonTable } from 'apple-liquid-glass-ui';// Basic skeleton
// Animation types
// Default shimmering effect
// Opacity pulsing
// No animation
// Text lines
// Avatar placeholder
// Card with avatar and text
// Table placeholder
`Skeleton Props:
-
variant: 'text' | 'circular' | 'rectangular' | 'rounded'
- width: Width in pixels or percentage
- height: Height in pixels or percentage
- animation: 'wave' | 'pulse' | falseSkeletonText Props:
-
lines: Number of lines (default: 3)
- width: Width for all lines except last
- animation: Animation typeSkeletonAvatar Props:
-
size: 'sm' | 'md' | 'lg' | 'xl'
- animation: Animation typeSkeletonCard Props:
-
avatar: Show avatar (default: true)
- lines: Number of text lines (default: 3)
- animation: Animation typeSkeletonTable Props:
-
rows: Number of rows (default: 5)
- columns: Number of columns (default: 4)
- animation: Animation type$3
Context menus and dropdown menus with glass styling:
`tsx
import { Menu } from 'apple-liquid-glass-ui'; trigger={}
position="bottom"
items={[
{ key: 'edit', label: 'Edit', icon: 'āļø', shortcut: 'āE', onClick: handleEdit },
{ key: 'duplicate', label: 'Duplicate', icon: 'š', onClick: handleDuplicate },
{ type: 'divider' },
{ type: 'label', label: 'Danger Zone' },
{ key: 'delete', label: 'Delete', icon: 'šļø', danger: true, onClick: handleDelete },
{ key: 'disabled', label: 'Disabled Action', disabled: true }
]}
/>
`Props:
-
trigger: Element to click to open menu
- position: 'top' | 'bottom' | 'left' | 'right'
- items: Array of menu items, dividers, or labelsMenuItem Type:
-
key: Unique identifier
- label: Display text
- icon: Optional icon element
- shortcut: Optional keyboard shortcut display
- danger: Red text for destructive actions
- disabled: Disable interaction
- onClick: Callback when clicked$3
Data tables with sorting, hover effects, and glass styling:
`tsx
import { Table } from 'apple-liquid-glass-ui';// Basic table
Name
Email
Status
Sarah Chen
sarah@example.com
Active
// Table with sorting
const [sortColumn, setSortColumn] = useState(null);
const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('asc');
sortable
sorted={sortColumn === 'name' ? sortDirection : null}
onSort={() => {
if (sortColumn === 'name') {
setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
} else {
setSortColumn('name');
setSortDirection('asc');
}
}}
>
Name
Project
Progress
{sortedData.map((row) => (
{row.name}
{row.project}
{row.progress}%
))}
// Compact table
{/ ... /}
`Props:
- Table:
hover, striped, size ('sm' | 'md' | 'lg')
- Table.Head: sortable, sorted ('asc' | 'desc' | null), onSort, align ('left' | 'center' | 'right')
- Table.Cell: align ('left' | 'center' | 'right')Features:
- Glassmorphism styling with backdrop blur
- Sortable column headers with arrow indicators
- Hover effect on rows
- Striped rows for better readability
- Three size variants (sm, md, lg)
- Responsive design with horizontal scrolling
- Cell alignment options
Theming
Toggle between light and dark themes:
`tsx
// Toggle theme
const theme = document.documentElement.getAttribute('data-gl-theme');
document.documentElement.setAttribute('data-gl-theme', theme === 'light' ? 'dark' : 'light');
`CSS Variables
All design tokens are available as CSS variables:
`css
var(--gl-color-bg)
var(--gl-color-surface)
var(--gl-color-border)
var(--gl-color-accent)
var(--gl-radius-lg)
var(--gl-blur-surface)
var(--gl-shadow-soft)
var(--gl-space-md)
var(--gl-font-size-md)
``See tokens.css for the complete list.
MIT