Reactivity

Signal-based state. No virtual DOM.

State

Declare reactive variables with state. When they change, the DOM auto-updates:

state count = 0 state name = "Nyx"

Computed

Derived values that recalculate when dependencies change:

state price = 10 state quantity = 3 computed total = price * quantity

Event binding

The -> operator binds click events to state mutations:

button "+" -> count = count + 1 button "Reset" -> count = 0

Two-way binding

Bind inputs to state with bind=:

state name = "" input bind=name placeholder="Enter name" p name

Effect

Side effects that run when referenced state changes:

effect { console.log(count) }

Displaying state

Use a state variable name as element content. It auto-updates when the value changes:

state count = 0 h1 count p "Static text"

NyxCode uses signal-based reactivity (like SolidJS) — no diffing, no virtual DOM, no re-renders.

← Components Pseudo-Elements →