The Pure Vanilla JavaScript Library

MicroUI makes DOM manipulation and event handling simple and efficient. Modern ES6+ features in just 18.6KB minified (5.2KB gzipped).

5.2KB Gzipped
6x Smaller than jQuery
100% Vanilla JavaScript

Why Choose MicroUI?

Ultra Lightweight

Only 18.6KB minified (5.2KB gzipped) - 6x smaller than jQuery while providing comprehensive functionality.

📦

Pure Vanilla JS

Zero dependencies, no frameworks. Built with native JavaScript APIs for maximum compatibility and performance.

🎯

Modern JavaScript

Built with ES6+ features like Promises, async/await, and Web Animations API.

🔧

Easy to Use

Familiar jQuery-like syntax with modern improvements and better error handling.

📱

Mobile First

Optimized for mobile devices with touch-friendly event handling and responsive design.

🧪

Well Tested

Comprehensive test suite with 72+ tests ensuring reliability and stability across all features.

📈 Performance Comparison

Bundle Sizes (Gzipped)

MicroUI 5.2KB
React 18 13KB
Alpine.js 15KB
Vue 3 16KB
jQuery 30KB

Performance Benefits

Bundle Size 5.2KB
Dependencies Zero
Framework Overhead None
Build Required Optional

Why It Matters

  • 🚀 Faster loading = better user experience
  • 📱 Mobile friendly = works on slower devices
  • 💰 Lower costs = less bandwidth usage
  • 🔍 SEO boost = Google loves fast sites

Getting Started

Installation
// Via jsDelivr CDN (Latest)
<script src="https://cdn.jsdelivr.net/gh/lam0819/MicroUI@latest/dist/microui.min.js"></script>

// Via jsDelivr CDN (Specific Version)
<script src="https://cdn.jsdelivr.net/gh/lam0819/[email protected]/dist/microui.min.js"></script>

// Download from GitHub Releases
// https://github.com/lam0819/MicroUI/releases
Basic Usage
// DOM Selection
const element = MicroUI.$('#my-element');
const elements = MicroUI.$$('.my-class');

// Event Handling
MicroUI.on('click', '.button', function() {
  MicroUI.addClass(this, 'clicked');
});

// AJAX Requests
MicroUI.ajax('/api/data')
  .then(data => console.log(data))
  .catch(error => console.error(error));

Interactive Examples

🎮 View All Examples & Demos

Explore comprehensive examples including basic usage, advanced features, and interactive playground

DOM Manipulation Demo

This is a demo element. Try the buttons above!

AJAX Demo

Click a button to fetch data...

Event Handling Demo

Events will be logged here...

How MicroUI Compares

Feature MicroUI jQuery Vanilla JS
Bundle Size 18.6KB 87KB 0KB
Modern Syntax ✅ ES6+ ❌ ES5 ✅ Native
Promise Support ✅ Native ❌ Custom ✅ Native
Animation API ✅ Web Animations ❌ CSS Only ✅ Native
Learning Curve Easy Easy Steep
Browser Support Modern IE6+ Modern

API Documentation

DOM Selection & Manipulation
// Selection
MicroUI.$('selector')        // Single element
MicroUI.$$('selector')       // Multiple elements

// Classes
MicroUI.addClass(el, 'class')
MicroUI.removeClass(el, 'class')
MicroUI.toggleClass(el, 'class')
MicroUI.hasClass(el, 'class')

// Content
MicroUI.html(el, 'content')
MicroUI.text(el, 'content')
MicroUI.append(el, 'content')
Events
// Event Delegation
MicroUI.on('event', 'selector', handler)
MicroUI.off('event', 'selector', handler)
MicroUI.once('event', 'selector', handler)

// Custom Events
MicroUI.trigger(el, 'customEvent', data)

// DOM Ready
MicroUI.ready(callback)
AJAX & Animations
// AJAX
MicroUI.ajax(url, options)
MicroUI.get(url, data)
MicroUI.post(url, data)

// Animations
MicroUI.fadeIn(el, duration)
MicroUI.fadeOut(el, duration)
MicroUI.slideUp(el, duration)
MicroUI.slideDown(el, duration)
MicroUI.animate(el, keyframes, options)