Lips UI Framework
Easy, straightforward and direcrly into the browser, no pre-build required.
<!DOCTYPE html>
<html>
<head>
<title>My Lips App</title>
</head>
<body>
<div id="app"></div>
<script type="module">
// Import from CDN directly in the module script
import Lips from 'https://cdn.jsdelivr.net/npm/@lipsjs/lips'
const lips = new Lips();
// <counter/> component
const counter = {
state: { count: 0 },
handler: {
increment() { this.state.count++; }
},
default: `
<div>
<h2>Count: {state.count}</h2>
<button on-click(increment)>Increment</button>
</div>
`
};
lips.root(counter, '#app');
</script>
</body>
</html>
- Introduction
- Getting Started
- Core Concepts
- Component API
- Template Syntax
- Built-in Components
<if>
,<else-if>
,<else>
<for>
<switch>
,<case>
<async>
,<then>
,<catch>
<router>
<let>
and<const>
- Advanced Features
- Styling
- Internationalization (i18n)
- Best Practices
- Examples
- API Reference
Introduction to Lips Framework
What is Lips?
Lips is a lightweight, reactive UI framework that runs directly in the browser. It offers a component-based architecture with fine-grained reactivity, making it ideal for building dynamic web applications with minimal overhead.
Unlike heavier frameworks that require build steps, Lips can be used by simply importing a script, allowing you to start developing immediately without complex tooling.
Key Features
- Lightweight and Runtime-Based: No build step required, just import and start using
- Component-Based Architecture: Create reusable, self-contained UI components
- Fine-Grained Reactivity: Efficient updates that only re-render what has changed
- Rich Template Syntax: Intuitive syntax for conditionals, loops, and component composition
- Built-in Performance Tracking: Monitor rendering performance with integrated benchmarking
- DOM Watcher: Automatically manages component lifecycle based on DOM presence
- Context API: Share state across components without prop drilling
- Internationalization Support: Built-in i18n features for multilingual applications
- Macros System: Create template shortcuts for common patterns
- Async Component Support: Handle asynchronous operations elegantly
- SVG Support: Create and manipulate SVG elements with ease
Comparison with Other Frameworks
Feature | Lips | React | Vue | Svelte |
---|---|---|---|---|
Runtime Only | ✓ | ✗ | ✗ | ✗ |
No Build Step | ✓ | ✗ | ✗ | ✗ |
Fine-Grained Updates | ✓ | ✗ | ✓ | ✓ |
Virtual DOM | ✗ | ✓ | ✓ | ✗ |
Built-in State Management | ✓ | ✗ | ✓ | ✓ |
Built-in Routing | ✓ | ✗ | ✗ | ✗ |
Performance Benchmarking | ✓ | ✗ | ✗ | ✗ |
File Size | Small | Medium | Medium | Small |
Browser Compatibility
Lips is designed to work in all modern browsers, including:
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)