I just open-sourced @mawtech/glass-ui β a React component library featuring that sleek Apple macOS/visionOS glassmorphism design.
I built this because I was tired of recreating the same glass effects for every project. Blurred backgrounds, subtle borders, smooth animations, it takes forever to get right.
So I packaged it all into a reusable library. And now it's free for everyone.
What I Built
18 production-ready React components with:
- β¨ Apple-inspired glassmorphism design
- π Dark mode optimized
- π Full TypeScript support
- π¬ Framer Motion animations
- βΏ Accessible (WCAG 2.1 AA)
- π³ Tree-shakeable
Installation
npm install @mawtech/glass-ui
Then import the styles:
import '@mawtech/glass-ui/styles.css';
That's it. You're ready to go.
Components
GlassCard
The foundation of any glass UI:
import { GlassCard } from '@mawtech/glass-ui';
function MyComponent() {
return (
<GlassCard variant="glow" padding="lg">
<h2>Hello World</h2>
<p>This looks so clean!</p>
</GlassCard>
);
}
The variant="glow" adds a subtle cyan glow on hover. One of my favorites.
GlassButton
Buttons that actually look premium:
import { GlassButton } from '@mawtech/glass-ui';
<GlassButton variant="primary">Primary</GlassButton>
<GlassButton variant="secondary">Secondary</GlassButton>
<GlassButton variant="ghost">Ghost</GlassButton>
<GlassButton variant="aurora">Aurora β¨</GlassButton>
The aurora variant has an animated gradient that shifts between cyan, violet, and pink. Great for CTAs.
GlassInput
Forms that don't look like they're from 2010:
import { GlassInput } from '@mawtech/glass-ui';
<GlassInput
label="Email"
placeholder="Enter your email"
type="email"
/>
Includes error states, icons, and a built-in password visibility toggle.
Real Example
Here's a login card you can build in minutes:
import { GlassCard, GlassInput, GlassButton } from '@mawtech/glass-ui';
function LoginCard() {
return (
<GlassCard variant="elevated" padding="xl">
<h2 className="text-2xl font-bold text-white mb-6">
Welcome Back
</h2>
<div className="space-y-4">
<GlassInput
label="Email"
type="email"
placeholder="you@example.com"
/>
<GlassInput
label="Password"
type="password"
placeholder="β’β’β’β’β’β’β’β’"
/>
<GlassButton variant="primary" fullWidth>
Sign In
</GlassButton>
<GlassButton variant="ghost" fullWidth>
Forgot password?
</GlassButton>
</div>
</GlassCard>
);
}
All 18 Components
- GlassCard
- GlassButton
- GlassInput
- GlassTextarea
- GlassSelect
- GlassCheckbox
- GlassSwitch
- GlassModal
- GlassNavbar
- GlassSidebar
- GlassDropdown
- GlassTooltip
- GlassTabs
- GlassToast (with useToast hook)
- GlassProgress
- GlassAvatar
- GlassBadge
- GlassCommandPalette (CMD+K menu)
Tech Stack
- React 18+
- TypeScript
- Tailwind CSS
- Framer Motion
- Radix UI (for accessibility)
Why I Built This
I run MAW Tech Solutions and I'm building several SaaS products. I needed a consistent, beautiful UI across all of them.
Instead of copy-pasting components between projects, I extracted them into this library. Now I use it for everything β and you can too.
Links
- π¦ npm: npmjs.com/package/@mawtech/glass-ui
- π Docs: glass-ui.mawtechsolutions.com
- π» GitHub: github.com/mawtechsolutions/react-glass-ui
What's Next
I'm actively maintaining this and planning to add:
- Light mode support
- More component variants
- Figma design kit
- Premium templates
Try It Out
npm install @mawtech/glass-ui
Give it a star on GitHub if you find it useful! β
I'd love to hear your feedback. What components would you like to see added? π
Top comments (0)