This project is part of the @thi.ng/umbrella monorepo.
- Usage examples
Lightweight, reactive, VDOM-less UI/DOM components with async lifecycle and @thi.ng/hiccup compatible.
ALPHA - bleeding edge / work-in-progress
HIC SUNT DRACONES
This is still a young project. Even though most of the overall approach, component lifecycle and API are fairly stable by now (after ~70 commits over several months), so far there's only sparing documentation and only a handful of public examples. After some more user feedback, there's likely going to be further refactoring required here and there, none of which is expected to cause breaking changes in this core package and will likely come in the form of additions or alternatives to existing control structures (unless they would be entirely subsuming current features/approaches)...
For the sake of deduplication of functionality and to keep the number of dependencies to a minimum, direct @thi.ng/atom integration has been removed in favor of using relevant @thi.ng/rstream constructs, which can be used as lightweight adapters, i.e.:
- @thi.ng/rdom-canvas - @thi.ng/rdom component wrapper for @thi.ng/hiccup-canvas and declarative canvas drawing
- @thi.ng/rdom-components - Collection of unstyled, customizable components for @thi.ng/rdom
yarn add @thi.ng/rdom
// ES module// UMD
Package sizes (gzipped, pre-treeshake): ESM: 3.73 KB / CJS: 3.87 KB / UMD: 3.85 KB
Several demos in this repo's /examples directory are using this package.
|Interactive visualization of closest points on ellipses||Demo||Source|
|Parser grammar livecoding editor/playground & codegen||Demo||Source|
|Demonstates various rdom usage patterns||Demo||Source|
|rdom drag & drop example||Demo||Source|
|rdom & hiccup-canvas interop test||Demo||Source|
|Full umbrella repo doc string search w/ paginated results||Demo||Source|
|rdom powered SVG graph with draggable nodes||Demo||Source|
Currently, documentation only exists in the form of small examples and various doc strings (incomplete). I'm working to alleviate this situation ASAP... In that respect, PRs are welcome as well!
;;;// reactive value;// color options (infinite iterable);// event handler;// define component tree in hiccup syntax, compile & mount component.// each time `bg` value changes, only subscribed bits will be updated// i.e. title, the button's `style.background` and its label// Note: instead of direct hiccup syntax, you could also use the// element functions provided by$compile.mountdocument.body;
© 2020 Karsten Schmidt // Apache Software License 2.0