Welcome to O!
O! is a very small (under 1KB) library designed to explain how React-like libraries work. It started as a quick morning experiment some cold autumn Friday, driven by the joy of seeing a simple counter component finally working. It’s really an exercise in minimalism - never meant to be used in serious projects, but perfect for learning and experimentation.Why O!?
The library is called “O!” - a sound of realization once you understood how simple it is. Or despair, if you caught a fatal bug after deciding to use this in production. It also resembles a zero, which is a metaphor for both library footprint and usefulness. Despite its humble goals, O! packs surprisingly complete features for understanding modern UI frameworks.Key Features
Tiny Footprint
Around 1KB when minified and gzipped - small enough to understand completely.
React Hooks
Includes
useState, useReducer, and useEffect hooks, just like real React.JSX-Like Syntax
Custom template syntax sugar using tagged templates, very similar to normal HTML.
Zero Dependencies
No dependencies, no transpiler needed. Just import a single file as a module.
What’s Included
- Core API:
h()andrender()functions with support for functional components - State Management:
useStateanduseReducerhooks for component state - Side Effects:
useEffecthook for lifecycle management - Template Syntax:
x` `tagged template for HTML-like component markup - SVG Support: Built-in support for SVG tags
- Browser Modules: Native ES module support - no build step required
Quick Example
Here’s a taste of what O! looks like:Get Started
Quickstart
Build your first counter app in minutes
API Reference
Explore the complete API documentation
Examples
See more examples and use cases