Web Components
CurrentShadowRootvariable
Selects an open shadow root by default. Provide false for light DOM. The selection is captured when the registration layer or server view runs.
Definitioninterface
An inert definition shared by browser registration and server rendering. Schemas supply optionality and defaults. Inputs are parent-owned; local writable state can be created in an Effect returned by render.
Elementinterface
A registered element accepts typed input through its props property. Assign a new object to update; nested mutation is not observed.
Fieldstype-alias
Schema fields for attributes and dot-prefixed DOM properties. Attribute schemas encode strings; property schemas accept decoded values.
Inputtype-alias
Typed initial values; only schema-optional or defaulted inputs may be omitted.
Propstype-alias
Decoded inputs, with the dot removed from property names.
RegistrationErrorclass
A browser registry could not accept a definition.
RenderPropstype-alias
Each field is a read-only computed value, including optional fields.
ShadowRootOptionstype-alias
Shadow settings supported by both attachShadow and declarative shadow DOM.
makefunction
Defines a custom element without reading any browser globals. Custom-element names use a conservative ASCII subset of the HTML grammar.
registerfunction
Registers in CurrentRenderDocument’s registry and captures the layer’s services. Provides no services; use the custom element through ordinary HTML templates. The layer’s Scope owns every connected instance. Closing it stops rendering and deactivates this class; browsers cannot unregister a custom element. Disconnect interrupts subscriptions/listeners; reconnect waits for cleanup before starting a fresh view. Failures dispatch typed:error with a Cause in CustomEvent.detail. Native template event handlers work without an adapter. Shadow roots retain slotted light children. Light mode owns all host children.
serverfunction
Produces a server Renderable with a custom-element host and hydratable content. Shadow mode emits declarative shadow DOM followed by optional slot content. Light mode owns all host children and rejects supplied slot content. Only properties declared in the attribute schema are serialized; match CurrentShadowRoot on the client. Body and slot chunks retain their order, errors, services, and calling Scope. Use Typed’s renderToHtml to stream or renderToHtmlString to collect the result.