MC (Micro Component) is a JavaScript framework plugin library that extends jQuery by providing seamless reactivity. It enables the creation of modular components and reactive UI logic in legacy jQuery applications, simplifying the development of dynamic, interactive features. MC offers a component/hook-style API (similar to modern frameworks) without additional dependencies. This makes it easy to gradually add reactivity to existing jQuery-based projects.
Docs:
see the documentation for a full understanding of the installation!
Key Features
- Seamless jQuery integration: MC works alongside your current jQuery code. You include it after jQuery and then use $-style component mounting or its static API (no build step required). - Lightweight and modular: The entire MC library is very small (only ~11KB minified) and provides component-based structure. You can split UI into reusable components or functions without rewriting your app. - Reactive state management: MC adds simple reactive state to jQuery. In class-based components you use super.state() to create proxy-based state; in function components you use hooks like MC.uState() (which caches state across renders). - Hooks-style API: For functional components, MC provides familiar hooks such as $.MC.effect(), $.MC.memo(), and MC.uContext(). - Declarative rendering: Components define their UI via jQuery element builders. MC automatically re-renders affected parts of the DOM when state changes. This lets you declaratively describe interfaces without manual DOM updates. - Well-documented: The project includes examples and documentation (on GitHub and in this README) to guide a smooth developer experience.
Installation
$3
``bash npm install jquery-micro_component ` Then include it: `html
`
$3
Download MC.min.js and include it manually after jQuery.