live · runnableaihu-counter
Human render — try it

This counter is the real aihu-counter recipe, compiled at build and hydrated as an island — fully interactive right here. In-browser recompilation (the WASM playground) is the next phase.

Governed examples

9 · CI-built
G1
todo-mvcbuild
Core reactivity + template grammar
statederivedactioneffectonMounteach+16
G2
hacker-newscompile+smoke
SSR meta-framework
propactionrouteroute.dynamicdefineLoaderssr-hydration+11
G3
layoutsbuild
Router / layouts / navigation
routeroute.headroute.layoutoutleta-enhanced
G4
storefrontcompile+smoke
Data + app-state platform
statederivedactionprovideifeach+9
G5
realtime-scorescompile+smoke
Streaming / realtime
stateonMountonDisposewebsocketeachkey+3
G6
css-engine-utilitybuild
Styling system
routecss-utility-foldcss-container-querypkg:css-engine
G7
agent-driven-democompile+smoke
Agent surface / GX governance
stateactioneachkeyinterpolationaction.expose+3
G8
ssg-sitebuild
SSG / static output
output:staticrouteroute.headeachkeyinterpolation+12
G9
agent-hubcompile+smoke
Agent protocols (A2A + ACP)
statederivedactionprovideifeach+8

Cookbook recipes

20 shown
agentRun

Agent Weather

Agent-surface async fetch — prop city and action fetchForecast carry expose/describe so MCP agents can read and invoke them.

propprop.exposeprop.describestate+9
container

Accordion

Accordion — each/key over prop-provided items, show toggles the open panel, aria-expanded tracks state.

propstateactioneach+5
display

Clock

Real-time clock — onMount starts the interval, onDispose clears it; tick runs through an action.

stateactiononMountonDispose+1
display

Controller

controller() intrinsic — a ResizeObserver reactive controller with hostConnected/hostDisconnected lifecycle, writes routed through an action.

stateactioncontrollercontroller.describe+1
displayRun

Counter

Minimal reactive counter — prop-backed count with increment/decrement/reset actions.

propactionon:clickinterpolation
container

Modal

Modal dialog — aria() declares role/aria-modal on the host, show toggles visibility, Escape and backdrop click dismiss.

propariaactionshow+3
container

Tabs

Tabs — derived() computes the selected tab, each/key renders the tablist, onMount picks the initial tab.

propstatederivedaction+8
container

Toast

Toast — auto-dismiss via onMount setTimeout, manual dismiss action, aria-live polite status region.

propstateactiononMount+4
form

ARIA Form

Form-associated element — aria() maps role/label/describedby, form() exposes value and validity to the surrounding form.

ariastateformaction+2
container

Context Consumer

consume() intrinsic — reads the 'theme' token provided by an ancestor context-provider.

consumeinterpolation
container

Context Provider

provide() intrinsic — exposes a theme token to descendant consumers over the context prototype chain.

stateprovideactionslot+1
list

Data Table

Sortable data table — derived() sorts a copy of the prop rows, each/key renders rows, click headers to toggle direction.

propstatederivedaction+4
async

Fetch Resource

resource() intrinsic — async fetch with loading/error/value states rendered through an if/elseif/else chain.

propresourcegroupif+3
form

Form Validation

Live validation — form() exposes value/validity, derived() computes the error message, touched gates when errors show.

stateformderivedaction+5
agent

Guard UI

<guard> element — scope-gated UI that renders its children only when the 'admin' scope is verified.

guardinterpolation
list

Infinite Scroll

Infinite scroll — controller() wires an IntersectionObserver sentinel that calls the loadMore action; each/key/empty renders the list.

propstateactioncontroller+7
list

Search Debounce

Debounced search — bind:value feeds the query, effect() debounces 300ms into a second state, derived() filters results.

stateeffectderivedbind:value+6
ssr-ssg

SSR Hydration

SSR-safe bootstrapping — props render placeholders on the server; onMount reads server-stamped dataset values after hydration.

propstateonMountinterpolation
display

Tailwind Style

Tailwind utilities in the template coexisting with a scoped @style block for component-specific rules.

stateactionon:clickinterpolation
display

Theme Toggle

Theme switcher — state-backed theme is provided to descendants and mirrored onto documentElement by an effect.

stateprovideeffectaction+2