Skip to content

Commit 74ddaea

Browse files
committed
Added more info for newcomers
1 parent f4bb38c commit 74ddaea

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,102 @@ Rimmel is a powerful, fast and lightweight JavaScript UI library for creating we
1010

1111
It implements [RML](https://github.com/ReactiveHTML/reactive-markup), the Reactive Markup which makes your HTML work with Streams in a seamless way.
1212

13+
## Quick Start
14+
15+
### Installation
16+
17+
```bash
18+
# Using npm
19+
npm install rimmel rxjs
20+
21+
# Using yarn
22+
yarn add rimmel rxjs
23+
24+
# Using pnpm
25+
pnpm add rimmel rxjs
26+
```
27+
28+
### Basic Usage
29+
30+
```js
31+
import { rml } from "rimmel";
32+
import { Subject } from "rxjs";
33+
34+
const counter = new Subject();
35+
36+
document.body.innerHTML = rml`
37+
<button onclick="${counter}">Click me</button>
38+
<div>Clicks: ${counter}</div>
39+
`;
40+
```
41+
42+
## Key Features
43+
44+
- **Stream-First Architecture**: Everything is a stream - events, data, UI updates
45+
- **No Virtual DOM**: Direct DOM updates via optimized "sinks"
46+
- **Tiny Bundle Size**: Core is just 2.5KB, tree-shakeable imports
47+
- **Zero Build Requirements**: Works with plain JavaScript
48+
- **Automatic Memory Management**: Handles subscription cleanup
49+
- **Built-in Suspense**: Automatic loading states with BehaviorSubject
50+
- **Web Components Support**: Create custom elements easily
51+
- **TypeScript Support**: Full type definitions included
52+
53+
## Core Concepts
54+
55+
### Sources (Input)
56+
- DOM Events (`onclick`, `onmousemove`, etc)
57+
- Promises
58+
- RxJS Observables
59+
- Custom Event Sources
60+
61+
### Sinks (Output)
62+
- DOM Updates
63+
- Class Management
64+
- Style Updates
65+
- Attribute Changes
66+
- Custom Sinks
67+
68+
## Available Sinks
69+
70+
The library includes specialized sinks for common UI operations:
71+
72+
- `InnerHTML` - Update element content
73+
- `InnerText` - Safe text updates
74+
- `Class` - Manage CSS classes
75+
- `Style` - Update styles
76+
- `Value` - Form input values
77+
- `Disabled` - Toggle disabled state
78+
- `Readonly` - Toggle readonly state
79+
- `Removed` - Remove elements
80+
- `Sanitize` - Safe HTML rendering
81+
- `AppendHTML` - Append content
82+
- `PrependHTML` - Prepend content
83+
84+
## Development
85+
86+
```bash
87+
# Install dependencies
88+
npm install
89+
90+
# Run tests
91+
npm run test
92+
93+
# Build library
94+
npm run build
95+
96+
# Run demo app
97+
npm run kitchen-sink
98+
```
99+
100+
## Examples
101+
102+
Check out our examples:
103+
104+
- [Basic Demos](https://stackblitz.com/@dariomannu/collections/rimmel-js-getting-started)
105+
- [Advanced Patterns](https://stackblitz.com/@dariomannu/collections/rimmel-js-experiments)
106+
- [Web Components](https://stackblitz.com/@dariomannu/collections/web-components)
107+
- [Web Workers](https://stackblitz.com/@dariomannu/collections/web-workers)
108+
13109
## Getting started
14110
If you are new to reactive streams, there is a [3m crash-course](https://medium.com/@fourtyeighthours/the-mostly-inaccurate-crash-course-for-reactive-ui-development-w-rxjs-ddbb7e5e526e) tailored for UI development with Rimmel, arguably the simplest RxJS introduction around to get you started.
15111

0 commit comments

Comments
 (0)