Control
Defined in: js-api/src/u2core/component.ts:444
A component that renders: everything visual in u2 is one.
Extends
Extended by
Constructors
Constructor
new Control(
root?,scope?):Control
Defined in: js-api/src/u2core/component.ts:448
Parameters
| Parameter | Type |
|---|---|
root? | HTMLElement |
scope? | Scope |
Returns
Control
Overrides
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
_root | protected | HTMLElement | - | - | js-api/src/u2core/component.ts:445 |
_u2 | readonly | ComponentState | - | Component._u2 | js-api/src/u2core/component.ts:82 |
componentMeta? | public | ComponentMetaBase | The registry metadata of the tag that built this component, stamped by the spec renderer — the single source the introspection surface below is generated from. | Component.componentMeta | js-api/src/u2core/component.ts:77 |
specProps? | public | Record<string, unknown> | The props the registry's create was handed, stamped alongside componentMeta: the last resort of the property read below, for a component that keeps a prop under another name or not at all (a create wrapping a bare element). Construction-time values — a live one always wins. | Component.specProps | js-api/src/u2core/component.ts:81 |
Accessors
aiDescription
Get Signature
get aiDescription():
string|null
Defined in: js-api/src/u2core/component.ts:152
A short AI-facing briefing, seeded from the registry's usage or description.
Returns
string | null
Set Signature
set aiDescription(
x):void
Defined in: js-api/src/u2core/component.ts:156
Parameters
| Parameter | Type |
|---|---|
x | string | null |
Returns
void
Inherited from
ambientAdoption
Get Signature
get
protectedambientAdoption():boolean
Defined in: js-api/src/u2core/component.ts:255
Whether a component constructed inside an ambient scope is disposed with it.
Returns
boolean
Inherited from
name
Get Signature
get name():
string|undefined
Defined in: js-api/src/u2core/component.ts:469
A named control carries its name in the DOM: data-u2-name is the stable automation id
selectors, tutorials and agents address the control by — the same attribute the spec renderer
stamps on named nodes, so hand-built and spec-built UI share one selector vocabulary.
Derived names (an input's label fallback) never stamp — see Component.deriveName.
Returns
string | undefined
Set Signature
set name(
x):void
Defined in: js-api/src/u2core/component.ts:473
Unique within a spec: the anchor for selection, patches and automation. An accessor pair
(not a field), so a platform descendant's own name accessors override it legally (TS2611).
Parameters
| Parameter | Type |
|---|---|
x | string | undefined |
Returns
void
Overrides
propertyTarget
Get Signature
get propertyTarget():
unknown
Defined in: js-api/src/u2core/component.ts:250
What this component's properties are read from and written to — prop.get(target) /
prop.set(target, v): the component itself, unless an adoption says otherwise.
Returns
unknown
Inherited from
propertyTier
Get Signature
get propertyTier():
boolean
Defined in: js-api/src/u2core/component.ts:244
The second binding tier is on: every property getProperties declares is a bind step, read and written on propertyTarget. Off for a plain u2 component, whose signal-less meta props are construction-time options.
Returns
boolean
Inherited from
root
Get Signature
get root():
HTMLElement
Defined in: js-api/src/u2core/component.ts:455
Returns
HTMLElement
Set Signature
set root(
x):void
Defined in: js-api/src/u2core/component.ts:459
Parameters
| Parameter | Type |
|---|---|
x | HTMLElement |
Returns
void
scope
Get Signature
get scope():
Scope
Defined in: js-api/src/u2core/component.ts:53
Minted on first use; assigned before _scopeMinted fires, so the hook's own
this.scope.own(...) reads the stored scope instead of re-entering the mint.