@mesh-gradient/core
v1.5.0
Published
The SwiftUI Mesh Gradient abstraction for web
Downloads
2,255
Readme
Web Mesh Gradient
A library for creating beautiful animated mesh gradients in the browser. Inspired by SwiftUI Mesh Gradient with WebGL rendering support and performance optimization.
✨ Features
- 🔄 Smooth Transitions - Animated transitions between configurations
- 🎨 Customizable Colors - Support for up to 4 colors simultaneously
- ⚡ Static Mode - Optimized mode for static gradients
- 📱 Responsive - Automatic pause when out of viewport
- 🚀 High Performance - Autopause on leave viewport, resize throttling, WebGL hardware accelerated graphics
- 🛠️ TypeScript - Full type support
- 📦 Lightweight - Zero dependencies,
8kbgzip
Documentation
Documentation website available here.
⚠️ Important Notes
- Canvas Element - Ensure the canvas element exists before initialization
- WebGL Support - The library requires WebGL support in the browser
- Resource Cleanup - Use
destroy()when removing the component - Performance - Use
isStatic: truefor static gradients
🛠️ Development
# Clone repository
git clone https://github.com/mikhailmogilnikov/mesh-gradient.git
# Install dependencies
pnpm install
# Development
pnpm dev
# Build
pnpm build📄 License
MIT © Mikhail Mogilnikov
🤝 Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss.
