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
Get Started View on GitHub

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/MicroUI@v1.0.0/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)