Skip to content

pantoken / renderers/web-components/src / RegisterContext

Interface: RegisterContext

Alpha

The shared state a register() call builds once and threads to every ElementDefinition. It carries the prefix-aware registry adapter, the tag() helper for nested markup, the CSS-class prefix I, the Invoker Commands support flag + router, and the wrapper/variantClass/iconSvg factories the simple elements share.

Properties

registry

registry: ElementRegistry

Alpha

The scoped registry: rewrites instui-<base> → the active-prefix tag on get/define.


tag

tag: (base) => string

Alpha

Map a base name to the active-prefix tag (for nested markup, querySelector, tagName).

Parameters

base

string

Returns

string


I

I: object

Alpha

The CSS-class prefix for the inlined component sheets — always instui, separate from the tag prefix.

prefix

readonly prefix: "instui"


invokerSupported

invokerSupported: boolean

Alpha

Whether the browser supports the Invoker Commands API (command/commandfor).


onCommand

onCommand: (target, handler) => void

Alpha

Route a target's command events (or a click fallback) to a handler.

Parameters

target

HTMLElement

handler

(command, source) => void

Returns

void


wrapper

wrapper: (tag, css, render, options?) => void

Alpha

Define a shadow-DOM element: <style>:host{display}css</style> + markup from render(host). invoker: true forwards the host's popovertarget/command to the inner <button> (IDL).

Parameters

tag

string

css

string

render

(host) => string

options?
display?

string

invoker?

boolean

Returns

void


variantClass

variantClass: (name, host) => string

Alpha

Build a .instui-<name> class with an optional -color-<variant> modifier from variant.

Parameters

name

string

host

HTMLElement

Returns

string


iconSvg

iconSvg: (name) => string

Alpha

Resolve an icon name to inline SVG (empty string when unknown).

Parameters

name

string

Returns

string