JoyDomComponent

fun interface JoyDomComponent

Renderer for a node type, registered via the components DSL. A component receives a ComponentScope giving it the current com.j0y.joy.dom.layout.ResolvedNode and its parent, a Children composable to render the node's children as a container, and an emit hook into the event system.

Declared as a fun interface so registrations stay terse:

component("rating-stars") { /* `this` is the ComponentScope */}

A component may be registered for ANY type, including the built-ins (div, span, p, h1h6, img); a registered type always wins over the built-in renderer.

Functions

Link copied to clipboard