Guides: Thorm Fundamentals
Start with nodes, then build up to props, state, actions, and effects.
Your choice is saved across the docs.
Start with nodes
Thorm UIs are built from nodes. A node is a structured description of a DOM element, text, or a higher-level construct like a fragment or route. Everything else layers on top of that.
Node builders
Use node builders to describe DOM structure. These create an IR tree, not HTML strings.
- el(tag, props, children) - generic element
- text(value) - text node
- html(value) - raw HTML injection
- fragment(children) - groups without wrapper
- show(cond, node) - conditional node
- repeat(items, key, tpl) - list rendering
- link(to, props, children) - client nav
- route(table, fallback) - router outlet
- slot(name) + component(tpl, props, slots)
PHP
Expression builder
Use thorm() when expressions become too nested or hard to read. It builds the same IR, but in a more declarative, tree-first format.
- Expression builder guide - runtime-safe logic with thorm()
- thorm(code) - build expressions from array trees
Effects + targets
Effects are background reactions tied to lifecycle, timers, visibility, or external events.
- onMount / watch / every / after
- onVisible / onLeftViewport
- onWindow / onDocument / onSelf
- Targets: windowTarget / documentTarget / selectorTarget
PHP
On this page