zouloux / reflex

Reflex is a tiny and fast reactive UI library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reflex

Reflex is a tiny and fast reactive UI library.

  • ๐Ÿฆ‹ Super lightweight and 0 dependency, about ~4kb min-zipped
  • ๐ŸŽ Highly performant diffing algorithm ( Proof )
  • ๐Ÿ”‹ Batteries included with factory extensions
  • โš›๏ธ Truly reactive, states are Signals by design
  • ๐Ÿ” Fine grained DOM updates for even better performances, components are rendered only when needed
  • ๐Ÿค“ Typed JSX
  • ๐Ÿฐ Easy to learn
  • ๐Ÿค˜๏ธ HMR Support for Vite

npm

gzip size brotli size


Quick example

# Install with npm
npm i reflex-dom
import { h, render, state } from 'reflex-dom';
export function App (props) {
  const counter = state(0);
  const increment = () => counter.value++;
  const reset = () => counter.value = 0;
  return () => <div>
    <h1>Hello from {props.name} ๐Ÿ‘‹</h1>
    <button onClick={increment}>Increment</button>&nbsp;
    <button onClick={reset}>Reset</button>&nbsp;
    <span>Counter : {counter}</span>
  </div>
}
render( <App name="Reflex" />, document.body );


๐ŸŽฎ - Play with this example on StackBlitz

๐Ÿ‘จโ€๐Ÿซ - Learn Reflex in 5 minutes

๐Ÿ“˜ - See API documentation

About

Reflex is a tiny and fast reactive UI library.

License:MIT License


Languages

Language:TypeScript 99.0%Language:JavaScript 0.5%Language:HTML 0.4%Language:Less 0.1%