Skip to content

@jimka/typescript-ui / component/container / Legend

Class: Legend

Defined in: src/typescript/lib/component/container/Legend.ts:22

A legend component backed by a <legend> element.

Uses static CSS positioning so the browser can render the title text inside a fieldset border.

Extends

Constructors

new Legend()

ts
new Legend(options?: LegendOptions): Legend

Defined in: src/typescript/lib/component/container/Legend.ts:24

Parameters

options?

LegendOptions

Returns

Legend

Overrides

Text.constructor

Methods

addComponent()

ts
addComponent(component: Component, constraints?: LayoutConstraints): this

Defined in: src/typescript/lib/core/Component.ts:2774

Adds a child component, appends its element, wires preferred-size change propagation, and triggers layout.

Parameters

component

Component

The child component to add.

constraints?

LayoutConstraints

Optional. Layout constraints to pass to the layout manager.

Returns

this

Inherited from

Text.addComponent


addComponents()

ts
addComponents(...specs: (
  | Component<ComponentOptions>
  | ConstrainedComponent
  | (
  | Component<ComponentOptions>
  | ConstrainedComponent)[])[]): this

Defined in: src/typescript/lib/core/Component.ts:2752

Adds multiple child components in a single call, with optional per-component layout constraints.

Each argument is either a Component (added with no constraints), a ConstrainedComponent pair (added with the supplied constraints), or an array of either form (each entry is processed in order). All three forms can be freely mixed in the same call.

Parameters

specs

...( | Component<ComponentOptions> | ConstrainedComponent | ( | Component<ComponentOptions> | ConstrainedComponent)[])[]

The components to add. Each entry is a bare Component, a ConstrainedComponent pair, or an array of either.

Returns

this

This component, for method chaining.

Inherited from

Text.addComponents


applyStyle()

ts
applyStyle(element: HTMLElement): this

Defined in: src/typescript/lib/component/input/Text.ts:872

Applies all text-specific style properties to the element's CSS rule in addition to base styles.

Parameters

element

HTMLElement

The HTMLElement to apply styles to.

Returns

this

Inherited from

Text.applyStyle


centerInHeight()

ts
centerInHeight(px: null | number): this

Defined in: src/typescript/lib/component/input/Text.ts:732

Sets the line-height equal to the given pixel height so a single-line text sits vertically centred in a fixed-height inline box.

Parameters

px

Pixel value matching the container's height, or null to revert to the theme's --ts-ui-line-height multiplier.

null | number

Returns

this

This component, for method chaining.

Example

typescript
const label = new Text("File");
label.centerInHeight(28);

Inherited from

Text.centerInHeight


clearAnimation()

ts
clearAnimation(): this

Defined in: src/typescript/lib/core/Component.ts:2268

Removes the CSS animation property from the component's CSS rule.

Returns

this

This component, for method chaining.

Inherited from

Text.clearAnimation


clearAppearance()

ts
clearAppearance(): this

Defined in: src/typescript/lib/core/Component.ts:1314

Removes both the -webkit-appearance and appearance CSS properties.

Returns

this

This component, for method chaining.

Inherited from

Text.clearAppearance


clearBackgroundColor()

ts
clearBackgroundColor(): this

Defined in: src/typescript/lib/core/Component.ts:950

Removes the background-color CSS property so the element inherits from its parent.

Returns

this

This component, for method chaining.

Inherited from

Text.clearBackgroundColor


clearBackgroundImage()

ts
clearBackgroundImage(): this

Defined in: src/typescript/lib/core/Component.ts:989

Removes the background-image CSS property from the component's CSS rule.

Returns

this

This component, for method chaining.

Inherited from

Text.clearBackgroundImage


clearBorder()

ts
clearBorder(): this

Defined in: src/typescript/lib/core/Component.ts:1086

Clears the component's border by applying an explicit 0-width, none-style, black-colour border on every side. The longhand writes guarantee the cleared state overrides any inherited or class-level border styling.

Returns

this

This component, for method chaining.

Inherited from

Text.clearBorder


clearBorderImage()

ts
clearBorderImage(): this

Defined in: src/typescript/lib/core/Component.ts:1354

Removes the border-image CSS property from the element.

Returns

this

This component, for method chaining.

Inherited from

Text.clearBorderImage


clearBorderRadius()

ts
clearBorderRadius(): this

Defined in: src/typescript/lib/core/Component.ts:1198

Removes the border-radius CSS property from the element.

Returns

this

This component, for method chaining.

Inherited from

Text.clearBorderRadius


clearColorScheme()

ts
clearColorScheme(): this

Defined in: src/typescript/lib/core/Component.ts:1059

Removes the color-scheme CSS property from the element.

Returns

this

This component, for method chaining.

Inherited from

Text.clearColorScheme


clearContain()

ts
clearContain(): this

Defined in: src/typescript/lib/core/Component.ts:2225

Removes the contain CSS property from the component's CSS rule.

Returns

this

This component, for method chaining.

Inherited from

Text.clearContain


clearCursor()

ts
clearCursor(): this

Defined in: src/typescript/lib/core/Component.ts:1156

Removes the inline cursor style from the element.

Returns

this

This component, for method chaining.

Inherited from

Text.clearCursor


clearForegroundColor()

ts
clearForegroundColor(): this

Defined in: src/typescript/lib/core/Component.ts:1028

Removes the color (foreground) CSS property so the element inherits from its parent.

Returns

this

This component, for method chaining.

Inherited from

Text.clearForegroundColor


clearInsets()

ts
clearInsets(): this

Defined in: src/typescript/lib/core/Component.ts:862

Resets the component's insets to zero on all sides.

Returns

this

This component, for method chaining.

Remarks

Companion to setInsets. Resets to new Insets(0, 0, 0, 0) — semantically a "reset to default" rather than a CSS-level clear.

Inherited from

Text.clearInsets


clearLineClamp()

ts
clearLineClamp(): this

Defined in: src/typescript/lib/component/input/Text.ts:850

Removes the line-clamp styling previously applied by setLineClamp.

Returns

this

This component, for method chaining.

Inherited from

Text.clearLineClamp


clearOpacity()

ts
clearOpacity(): this

Defined in: src/typescript/lib/core/Component.ts:2407

Removes the opacity property from the element's inline style, restoring full opacity from the CSS rule or default.

Returns

this

This component, for method chaining.

Inherited from

Text.clearOpacity


clearOutline()

ts
clearOutline(): this

Defined in: src/typescript/lib/core/Component.ts:1274

Removes the outline CSS property from the element.

Returns

this

This component, for method chaining.

Inherited from

Text.clearOutline


clearOverflow()

ts
clearOverflow(): this

Defined in: src/typescript/lib/core/Component.ts:2095

Removes the overflow CSS property from the component's CSS rule.

Returns

this

This component, for method chaining.

Inherited from

Text.clearOverflow


clearOverflowX()

ts
clearOverflowX(): this

Defined in: src/typescript/lib/core/Component.ts:2138

Removes the overflow-x CSS property from the component's CSS rule.

Returns

this

This component, for method chaining.

Inherited from

Text.clearOverflowX


clearOverflowY()

ts
clearOverflowY(): this

Defined in: src/typescript/lib/core/Component.ts:2181

Removes the overflow-y CSS property from the component's CSS rule.

Returns

this

This component, for method chaining.

Inherited from

Text.clearOverflowY


clearPadding()

ts
clearPadding(): this

Defined in: src/typescript/lib/core/Component.ts:911

Resets the CSS padding to zero on all sides.

Returns

this

This component, for method chaining.

Remarks

Companion to setPadding. Writes "0px 0px 0px 0px" rather than removing the property — preserves the legacy setPadding(null) behaviour as a reset, not a CSS-level clear.

Inherited from

Text.clearPadding


clearPointerEvents()

ts
clearPointerEvents(): this

Defined in: src/typescript/lib/core/Component.ts:2365

Removes the inline pointer-events property from the element.

Returns

this

This component, for method chaining.

Inherited from

Text.clearPointerEvents


clearPosition()

ts
clearPosition(): this

Defined in: src/typescript/lib/core/Component.ts:2055

Removes the explicit position override from the component's CSS rule. The framework default (Position.ABSOLUTE) reported by getPosition remains in effect.

Returns

this

This component, for method chaining.

Inherited from

Text.clearPosition


clearShadow()

ts
clearShadow(): this

Defined in: src/typescript/lib/core/Component.ts:1237

Removes the box-shadow by writing "none" (preserving the legacy setShadow(null) semantic — not a removeProperty).

Returns

this

This component, for method chaining.

Inherited from

Text.clearShadow


clearTextOverflow()

ts
clearTextOverflow(): this

Defined in: src/typescript/lib/component/input/Text.ts:770

Removes the text-overflow CSS property from the component's CSS rule.

Returns

this

This component, for method chaining.

Inherited from

Text.clearTextOverflow


clearTextShadow()

ts
clearTextShadow(): this

Defined in: src/typescript/lib/component/input/Text.ts:450

Removes the text-shadow CSS property from the component's CSS rule.

Returns

this

This component, for method chaining.

Inherited from

Text.clearTextShadow


clearTransform()

ts
clearTransform(): this

Defined in: src/typescript/lib/core/Component.ts:1397

Removes the transform CSS property from the element.

Returns

this

This component, for method chaining.

Inherited from

Text.clearTransform


clearUserSelect()

ts
clearUserSelect(): this

Defined in: src/typescript/lib/core/Component.ts:2526

Removes the user-select CSS property from the component's CSS rule.

Returns

this

This component, for method chaining.

Inherited from

Text.clearUserSelect


clearVerticalAlign()

ts
clearVerticalAlign(): this

Defined in: src/typescript/lib/core/Component.ts:1738

Removes the vertical-align CSS property from the element.

Returns

this

This component, for method chaining.

Inherited from

Text.clearVerticalAlign


clearWhiteSpace()

ts
clearWhiteSpace(): this

Defined in: src/typescript/lib/core/Component.ts:2485

Removes the white-space CSS property from the component's CSS rule.

Returns

this

This component, for method chaining.

Inherited from

Text.clearWhiteSpace


delAttribute()

ts
delAttribute(key: string): this

Defined in: src/typescript/lib/core/Component.ts:726

Removes a component-level attribute from both the internal map and the DOM element.

Parameters

key

string

The attribute name to remove.

Returns

this

Inherited from

Text.delAttribute


delLayoutConstraints()

ts
delLayoutConstraints(component: Component): 
  | undefined
  | null
  | LayoutConstraints

Defined in: src/typescript/lib/core/Component.ts:2967

Removes and returns the layout constraints for a child component.

Parameters

component

Component

The child component whose constraints to remove.

Returns

| undefined | null | LayoutConstraints

The removed LayoutConstraints, or null if no layout manager is set.

Inherited from

Text.delLayoutConstraints


dispose()

ts
dispose(): void

Defined in: src/typescript/lib/component/input/Text.ts:898

Removes the theme-change listener. Call when the component is permanently removed.

Returns

void

Inherited from

Text.dispose


doChildrenComponentLayouts()

ts
doChildrenComponentLayouts(): this

Defined in: src/typescript/lib/core/Component.ts:3042

Calls doLayout on each direct child component.

Returns

this

This component, for method chaining.

Inherited from

Text.doChildrenComponentLayouts


doLayout()

ts
doLayout(): this

Defined in: src/typescript/lib/core/Component.ts:3060

Delegates layout to the layout manager unless layout is currently paused.

Returns

this

This component, for method chaining.

Remarks

Throws an Error if no layout manager has been set.

Inherited from

Text.doLayout


flushLayout()

ts
flushLayout(): this

Defined in: src/typescript/lib/core/Component.ts:3107

Forces a synchronous layout pass on this component, removing it from the scheduled-layout queue if it was pending. Use when a layout-derived value must be read before the next animation frame.

Returns

this

This component, for method chaining.

Inherited from

Text.flushLayout


focus()

ts
focus(): this

Defined in: src/typescript/lib/core/Component.ts:2542

Moves browser focus to this component's DOM element.

Returns

this

This component, for method chaining.

Inherited from

Text.focus


getAnimation()

ts
getAnimation(): null | string

Defined in: src/typescript/lib/core/Component.ts:2241

Returns the CSS animation shorthand value, or null if not set.

Returns

null | string

The CSS animation string, or null.

Inherited from

Text.getAnimation


getAppearance()

ts
getAppearance(): null | string

Defined in: src/typescript/lib/core/Component.ts:1287

Returns the CSS appearance value last passed to setAppearance, or null if no appearance override is set.

Returns

null | string

The appearance string, or null.

Inherited from

Text.getAppearance


getAria()

ts
getAria(): Aria

Defined in: src/typescript/lib/core/Component.ts:797

Returns the Aria helper for this component, creating it lazily on first access.

Returns

Aria

The ARIA helper instance.

Inherited from

Text.getAria


getAttribute()

ts
getAttribute(key: string): undefined | String

Defined in: src/typescript/lib/core/Component.ts:698

Returns a component-level attribute value from the internal attributes map.

Parameters

key

string

The attribute name.

Returns

undefined | String

The stored attribute value, or undefined if not set.

Inherited from

Text.getAttribute


getAutoCommitStyle()

ts
getAutoCommitStyle(): boolean

Defined in: src/typescript/lib/core/Component.ts:579

Returns whether style changes are immediately committed to the DOM.

Returns

boolean

True if auto-commit is enabled, false if changes are batched.

Inherited from

Text.getAutoCommitStyle


getBackgroundColor()

ts
getBackgroundColor(): null | string

Defined in: src/typescript/lib/core/Component.ts:923

Returns the component's background color, or null if inherited.

Returns

null | string

The CSS color string, or null if none is set.

Inherited from

Text.getBackgroundColor


getBackgroundImage()

ts
getBackgroundImage(): null | string

Defined in: src/typescript/lib/core/Component.ts:966

Returns the background image CSS value, or null if none is set.

Returns

null | string

The CSS background-image string, or null.

Inherited from

Text.getBackgroundImage


getBaseline()

ts
getBaseline(): null | number

Defined in: src/typescript/lib/component/input/Text.ts:323

Returns the visual baseline of the rendered text, accounting for any border, padding, or framework insets on this component.

Returns

null | number

The baseline offset from the component's outer top, in pixels, or null when no text has been measured yet.

Remarks

Forces a measurement when the cached value is stale — the off-screen probe is deferred from construction so first-call timing shifts to whoever asks for a size first (usually doLayout).

Inherited from

Text.getBaseline


getBorder()

ts
getBorder(): null | Border

Defined in: src/typescript/lib/core/Component.ts:1075

Returns the Border instance, or null if no border is set.

Returns

null | Border

The current Border object, or null.

Inherited from

Text.getBorder


getBorderImage()

ts
getBorderImage(): null | string

Defined in: src/typescript/lib/core/Component.ts:1330

Returns the CSS border-image value last passed to setBorderImage, or null if no border-image is set.

Returns

null | string

The border-image string, or null.

Inherited from

Text.getBorderImage


getBorderRadius()

ts
getBorderRadius(): null | string

Defined in: src/typescript/lib/core/Component.ts:1172

Returns the CSS border-radius value, or null if not set.

Returns

null | string

The CSS border-radius string, or null.

Inherited from

Text.getBorderRadius


getBorderSize()

ts
getBorderSize(): PerimeterSize

Defined in: src/typescript/lib/core/Component.ts:1621

Returns the per-side pixel widths of the component's border.

Returns

PerimeterSize

A PerimeterSize with zero values on each side when no border is set.

Inherited from

Text.getBorderSize


getClassName()

ts
getClassName(): string

Defined in: src/typescript/lib/core/BaseObject.ts:44

Returns the runtime class name of this object.

Returns

string

The name of the constructor function as a string.

Inherited from

Text.getClassName


getColorScheme()

ts
getColorScheme(): null | string

Defined in: src/typescript/lib/core/Component.ts:1039

Returns

null | string

Inherited from

Text.getColorScheme


getComponents()

ts
getComponents(): Component<ComponentOptions>[]

Defined in: src/typescript/lib/core/Component.ts:2923

Returns the array of child components.

Returns

Component<ComponentOptions>[]

The live array of child Component instances.

Inherited from

Text.getComponents


getContain()

ts
getContain(): null | string

Defined in: src/typescript/lib/core/Component.ts:2197

Returns the CSS contain value, or null if not set.

Returns

null | string

The CSS contain string, or null.

Inherited from

Text.getContain


getCursor()

ts
getCursor(): null | string

Defined in: src/typescript/lib/core/Component.ts:1130

Returns the current CSS cursor value.

Returns

null | string

The CSS cursor string, or null if not set.

Inherited from

Text.getCursor


getDisabledAttribute()

ts
getDisabledAttribute(): boolean

Defined in: src/typescript/lib/core/Component.ts:2284

Returns the cached state of the HTML disabled attribute on the element.

Returns

boolean

True when the disabled attribute is set, false otherwise.

Inherited from

Text.getDisabledAttribute


getDisplay()

ts
getDisplay(): string

Defined in: src/typescript/lib/core/Component.ts:2022

Returns the CSS display mode for this component.

Returns

string

The current display value (e.g. "block", "grid", "flex").

Inherited from

Text.getDisplay


getElement()

ts
getElement(createIfMissing: boolean): HTMLElement

Defined in: src/typescript/lib/component/input/Text.ts:236

Returns the DOM element cast to HTMLElement.

Parameters

createIfMissing

boolean = false

Optional. When true, renders the element if it does not yet exist.

Returns

HTMLElement

The component's HTMLElement.

Inherited from

Text.getElement


getElementAttribute()

ts
getElementAttribute(key: string): undefined | null | string

Defined in: src/typescript/lib/core/Component.ts:484

Returns the value of a DOM element attribute, or undefined if the element is not in the DOM.

Parameters

key

string

The attribute name to retrieve.

Returns

undefined | null | string

The attribute value string, null if the attribute is absent, or undefined if the element is not in the DOM.

Inherited from

Text.getElementAttribute


getFontFamily()

ts
getFontFamily(): null | string

Defined in: src/typescript/lib/component/input/Text.ts:466

Returns the CSS font-family value.

Returns

null | string

The CSS font-family string, or null if not set.

Inherited from

Text.getFontFamily


getFontKerning()

ts
getFontKerning(): null | string

Defined in: src/typescript/lib/component/input/Text.ts:493

Returns the CSS font-kerning value.

Returns

null | string

The CSS font-kerning string, or null if not set.

Inherited from

Text.getFontKerning


getFontSize()

ts
getFontSize(): null | number

Defined in: src/typescript/lib/component/input/Text.ts:517

Returns the font size in pixels.

Returns

null | number

The font size as a number, or null if not set.

Inherited from

Text.getFontSize


getFontSizeAdjust()

ts
getFontSizeAdjust(): null | string

Defined in: src/typescript/lib/component/input/Text.ts:560

Returns the CSS font-size-adjust value.

Returns

null | string

The CSS font-size-adjust string, or null if not set.

Inherited from

Text.getFontSizeAdjust


getFontStretch()

ts
getFontStretch(): null | string

Defined in: src/typescript/lib/component/input/Text.ts:584

Returns the CSS font-stretch value.

Returns

null | string

The CSS font-stretch string, or null if not set.

Inherited from

Text.getFontStretch


getFontStyle()

ts
getFontStyle(): null | string

Defined in: src/typescript/lib/component/input/Text.ts:608

Returns the CSS font-style value (e.g. "normal", "italic").

Returns

null | string

The CSS font-style string, or null if not set.

Inherited from

Text.getFontStyle


getFontVariant()

ts
getFontVariant(): null | string

Defined in: src/typescript/lib/component/input/Text.ts:632

Returns the CSS font-variant value.

Returns

null | string

The CSS font-variant string, or null if not set.

Inherited from

Text.getFontVariant


getFontWeight()

ts
getFontWeight(): null | string

Defined in: src/typescript/lib/component/input/Text.ts:656

Returns the CSS font-weight value.

Returns

null | string

The CSS font-weight string, or null if not set.

Inherited from

Text.getFontWeight


getForegroundColor()

ts
getForegroundColor(): null | string

Defined in: src/typescript/lib/core/Component.ts:1001

Returns the foreground (text) color, or null if inherited.

Returns

null | string

The CSS color string, or null if none is set.

Inherited from

Text.getForegroundColor


getHeight()

ts
getHeight(): number

Defined in: src/typescript/lib/core/Component.ts:1844

Returns the component's current height in pixels.

Returns

number

The height in pixels, or 0 if the size is unavailable.

Inherited from

Text.getHeight


getId()

ts
getId(): string

Defined in: src/typescript/lib/core/BaseObject.ts:24

Returns the unique identifier for this object.

Returns

string

The UUID string assigned at construction time.

Inherited from

Text.getId


getInnerSize()

ts
getInnerSize(): 
  | null
  | {
  height: number;
  width: number;
}

Defined in: src/typescript/lib/core/Component.ts:1599

Returns the usable inner size: component size minus insets and border widths.

Returns

| null | { height: number; width: number; }

The inner Size in pixels, or null if the element is not yet in the DOM.

Inherited from

Text.getInnerSize


getInsets()

ts
getInsets(): Insets

Defined in: src/typescript/lib/core/Component.ts:835

Returns the component's insets (internal spacing used by layout managers).

Returns

Insets

The current Insets instance.

Inherited from

Text.getInsets


getLayoutConstraints()

ts
getLayoutConstraints(component: Component): 
  | undefined
  | LayoutConstraints

Defined in: src/typescript/lib/core/Component.ts:2934

Returns the layout constraints for a child component from the layout manager.

Parameters

component

Component

The child component whose constraints to retrieve.

Returns

| undefined | LayoutConstraints

The LayoutConstraints for the component, or undefined if none are set.

Inherited from

Text.getLayoutConstraints


getLayoutManager()

ts
getLayoutManager(): LayoutManager

Defined in: src/typescript/lib/core/Component.ts:2981

Returns the layout manager currently attached to this component.

Returns

LayoutManager

The current LayoutManager instance.

Inherited from

Text.getLayoutManager


getLineClamp()

ts
getLineClamp(): null | number

Defined in: src/typescript/lib/component/input/Text.ts:813

Returns the current line-clamp line count, or null if no clamp is applied.

Returns

null | number

The maximum line count, or null.

Inherited from

Text.getLineClamp


getLineHeight()

ts
getLineHeight(): null | number

Defined in: src/typescript/lib/component/input/Text.ts:683

Returns the line height in pixels, or null if not set.

Returns

null | number

The line height as a number, or null if not set.

Inherited from

Text.getLineHeight


getMaxSize()

ts
getMaxSize(): null | Size

Defined in: src/typescript/lib/core/Component.ts:1530

Returns the effective maximum size: the larger of the component and layout manager maximums.

Returns

null | Size

A Size object whose width and height are the element-wise maximums of the component and layout manager maximums.

Inherited from

Text.getMaxSize


getMinSize()

ts
getMinSize(): null | Size

Defined in: src/typescript/lib/core/Component.ts:1463

Returns the effective minimum size: the larger of the component and layout manager minimums.

Returns

null | Size

A Size object whose width and height are the element-wise maximums of the component and layout manager minimums.

Inherited from

Text.getMinSize


getOpacity()

ts
getOpacity(): null | number

Defined in: src/typescript/lib/core/Component.ts:2382

Returns the opacity value last passed to setOpacity, or null if no opacity has been set.

Returns

null | number

The opacity number, or null.

Inherited from

Text.getOpacity


getOutline()

ts
getOutline(): null | string

Defined in: src/typescript/lib/core/Component.ts:1250

Returns the CSS outline value last passed to setOutline, or null if no outline is set.

Returns

null | string

The outline string, or null.

Inherited from

Text.getOutline


getOverflow()

ts
getOverflow(): null | string

Defined in: src/typescript/lib/core/Component.ts:2071

Returns the CSS overflow value.

Returns

null | string

The CSS overflow string, or null if not set.

Inherited from

Text.getOverflow


getOverflowX()

ts
getOverflowX(): null | string

Defined in: src/typescript/lib/core/Component.ts:2111

Returns the CSS overflow-x value, or null if not set.

Returns

null | string

The CSS overflow-x string, or null.

Inherited from

Text.getOverflowX


getOverflowY()

ts
getOverflowY(): null | string

Defined in: src/typescript/lib/core/Component.ts:2154

Returns the CSS overflow-y value, or null if not set.

Returns

null | string

The CSS overflow-y string, or null.

Inherited from

Text.getOverflowY


getPadding()

ts
getPadding(): null | Insets

Defined in: src/typescript/lib/core/Component.ts:875

Returns the CSS padding insets for this component.

Returns

null | Insets

The current padding Insets, or null if none are set.

Inherited from

Text.getPadding


getParentComponent()

ts
getParentComponent(): 
  | null
| Component<ComponentOptions>

Defined in: src/typescript/lib/core/Component.ts:2735

Returns the parent component this component was added to, or null if it has no parent.

Returns

| null | Component<ComponentOptions>

The parent Component, or null.

Inherited from

Text.getParentComponent


getPerimiterSize()

ts
getPerimiterSize(): PerimeterSize

Defined in: src/typescript/lib/core/Component.ts:1644

Returns the total per-side consumed space: insets plus border widths.

Returns

PerimeterSize

A PerimeterSize where each side is the sum of the inset and border width for that side.

Inherited from

Text.getPerimiterSize


getPointerEvents()

ts
getPointerEvents(): null | string

Defined in: src/typescript/lib/core/Component.ts:2341

Returns the inline pointer-events value last passed to setPointerEvents, or null if not set.

Returns

null | string

The pointer-events string, or null.

Inherited from

Text.getPointerEvents


getPosition()

ts
getPosition(): Position

Defined in: src/typescript/lib/core/Component.ts:1993

Returns the CSS position mode for this component.

Returns

Position

The current Position value (e.g. Position.ABSOLUTE).

Inherited from

Text.getPosition


getPreferredSize()

ts
getPreferredSize(): null | Size

Defined in: src/typescript/lib/component/input/Text.ts:341

Returns the preferred size, lazily measuring the text on the first call.

Returns

null | Size

The preferred Size, or null per the inherited contract.

Remarks

Construction no longer eagerly probes document.body for text dimensions; the first reader of the preferred size pays the measurement cost. After attach this is doLayout, so the probe happens at layout time rather than construction time.

Inherited from

Text.getPreferredSize


getShadow()

ts
getShadow(): null | string

Defined in: src/typescript/lib/core/Component.ts:1213

Returns the CSS box-shadow value, or null if not set.

Returns

null | string

The CSS box-shadow string, or null.

Inherited from

Text.getShadow


getSize()

ts
getSize(): null | Size

Defined in: src/typescript/lib/core/Component.ts:1409

Returns the component's current width and height.

Returns

null | Size

A Size object with the current width and height in pixels.

Inherited from

Text.getSize


getTag()

ts
getTag(): string

Defined in: src/typescript/lib/core/Component.ts:359

Returns the HTML tag name used when creating this component's element.

Returns

string

The HTML tag string (e.g. "div", "button").

Inherited from

Text.getTag


getText()

ts
getText(): string

Defined in: src/typescript/lib/component/input/Text.ts:354

Returns the current text content, or an empty string if none is set.

Returns

string

The current text string, or "" if no text is set.

Inherited from

Text.getText


getTextAlign()

ts
getTextAlign(): null | string

Defined in: src/typescript/lib/component/input/Text.ts:402

Returns the current CSS text-align value.

Returns

null | string

The CSS text-align string, or null if not set.

Inherited from

Text.getTextAlign


getTextOverflow()

ts
getTextOverflow(): null | string

Defined in: src/typescript/lib/component/input/Text.ts:746

Returns the CSS text-overflow value last passed to setTextOverflow, or null if not set.

Returns

null | string

The text-overflow string, or null.

Inherited from

Text.getTextOverflow


getTextShadow()

ts
getTextShadow(): null | string

Defined in: src/typescript/lib/component/input/Text.ts:426

Returns the CSS text-shadow value.

Returns

null | string

The CSS text-shadow string, or null if not set.

Inherited from

Text.getTextShadow


getTransform()

ts
getTransform(): null | string

Defined in: src/typescript/lib/core/Component.ts:1373

Returns the CSS transform value last passed to setTransform, or null if no transform is set.

Returns

null | string

The transform string, or null.

Remarks

Reflects the value written to the component's CSS rule by setTransform. setTranslate writes transform as an inline style on a separate surface — its value is not reflected here. The two transform surfaces (rule vs. inline) are independent; the cached value here is the rule-side value only.

Inherited from

Text.getTransform


getTranslateX()

ts
getTranslateX(): number

Defined in: src/typescript/lib/core/Component.ts:1948

Returns the cached translate-X component of the element's transform (pixels).

Returns

number

The translate-X value last passed to setTranslate, or 0.

Inherited from

Text.getTranslateX


getTranslateY()

ts
getTranslateY(): number

Defined in: src/typescript/lib/core/Component.ts:1957

Returns the cached translate-Y component of the element's transform (pixels).

Returns

number

The translate-Y value last passed to setTranslate, or 0.

Inherited from

Text.getTranslateY


getUserSelect()

ts
getUserSelect(): null | string

Defined in: src/typescript/lib/core/Component.ts:2502

Returns the user-select value last passed to setUserSelect, or null if no value has been set.

Returns

null | string

The user-select string, or null.

Inherited from

Text.getUserSelect


getVerticalAlign()

ts
getVerticalAlign(): null | string

Defined in: src/typescript/lib/core/Component.ts:1718

Returns

null | string

Inherited from

Text.getVerticalAlign


getWhiteSpace()

ts
getWhiteSpace(): null | string

Defined in: src/typescript/lib/core/Component.ts:2455

Returns the CSS white-space value last written by setWhiteSpace, or null if cleared.

Returns

null | string

The white-space string, or null.

Inherited from

Text.getWhiteSpace


getWidth()

ts
getWidth(): number

Defined in: src/typescript/lib/core/Component.ts:1806

Returns the component's current width in pixels.

Returns

number

The width in pixels, or 0 if the size is unavailable.

Inherited from

Text.getWidth


getWillChange()

ts
getWillChange(): null | string

Defined in: src/typescript/lib/core/Component.ts:2419

Returns the cached will-change value last passed to setWillChange.

Returns

null | string

The active hint string, or null if no hint is set.

Inherited from

Text.getWillChange


getWordBreak()

ts
getWordBreak(): null | string

Defined in: src/typescript/lib/component/input/Text.ts:786

Returns the current CSS word-break value, or null if not set.

Returns

null | string

The word-break string, or null.

Inherited from

Text.getWordBreak


getX()

ts
getX(): number

Defined in: src/typescript/lib/core/Component.ts:1882

Returns the component's horizontal position (CSS left) in pixels.

Returns

number

The left offset in pixels.

Inherited from

Text.getX


getY()

ts
getY(): number

Defined in: src/typescript/lib/core/Component.ts:1915

Returns the component's vertical position (CSS top) in pixels.

Returns

number

The top offset in pixels.

Inherited from

Text.getY


hasElementAttribute()

ts
hasElementAttribute(key: string): undefined | boolean

Defined in: src/typescript/lib/core/Component.ts:467

Returns whether the DOM element has the given attribute set.

Parameters

key

string

The attribute name to check.

Returns

undefined | boolean

True if the attribute exists, false otherwise, or undefined if the element is not in the DOM.

Inherited from

Text.hasElementAttribute


insertComponent()

ts
insertComponent(
   component: Component, 
   index: number, 
   constraints?: LayoutConstraints): this

Defined in: src/typescript/lib/core/Component.ts:2819

Inserts a child component at the given index, appends its element at the matching DOM position, wires preferred-size change propagation, and triggers layout.

Parameters

component

Component

The child component to insert.

index

number

Zero-based insertion index. Values outside [0, children.length] are clamped.

constraints?

LayoutConstraints

Optional. Layout constraints to pass to the layout manager.

Returns

this

Remarks

Use this when child order matters — for example, placing a leading glyph before an existing label without removing and re-appending the label. addComponent(c, …) is the append-at-end shortcut for insertComponent(c, children.length, …).

Inherited from

Text.insertComponent


isLayoutPaused()

ts
isLayoutPaused(): boolean

Defined in: src/typescript/lib/core/Component.ts:3012

Returns true if layout has been paused for this component.

Returns

boolean

True if layout passes are currently suppressed.

Inherited from

Text.isLayoutPaused


isVisible()

ts
isVisible(): null | Boolean

Defined in: src/typescript/lib/core/Component.ts:738

Returns the visibility state, or null if inherited from the parent.

Returns

null | Boolean

True if explicitly visible, false if explicitly hidden, null if inheriting from the parent.

Inherited from

Text.isVisible


measure()

ts
measure(): void

Defined in: src/typescript/lib/component/input/Text.ts:305

Forces a one-off text measurement that ignores setAutoMeasure. Use when the caller has opted out of auto-measure but needs an up-to-date preferred size after a programmatic text change.

Returns

void

Inherited from

Text.measure


pauseLayout()

ts
pauseLayout(): this

Defined in: src/typescript/lib/core/Component.ts:3019

Suspends automatic layout passes until resumeLayout is called.

Returns

this

Inherited from

Text.pauseLayout


removeAllComponents()

ts
removeAllComponents(): this

Defined in: src/typescript/lib/core/Component.ts:2892

Removes all child components and their DOM elements without triggering layout.

Returns

this

This component, for method chaining.

Inherited from

Text.removeAllComponents


removeComponent()

ts
removeComponent(component: 
  | Number
  | Component<ComponentOptions>): 
  | undefined
  | null
  | LayoutConstraints

Defined in: src/typescript/lib/core/Component.ts:2862

Removes a child component by instance or index, detaches its element, and triggers layout.

Parameters

component

The Component instance to remove, or a Number index into the children array.

Number | Component<ComponentOptions>

Returns

| undefined | null | LayoutConstraints

The layout constraints that were registered for the removed component, or undefined.

Inherited from

Text.removeComponent


removeElement()

ts
removeElement(): this

Defined in: src/typescript/lib/core/Component.ts:449

Removes the component's DOM element from the document.

Returns

this

Inherited from

Text.removeElement


resumeLayout()

ts
resumeLayout(): this

Defined in: src/typescript/lib/core/Component.ts:3030

Resumes layout and immediately triggers a doLayout pass.

Returns

this

This component, for method chaining.

Inherited from

Text.resumeLayout


scheduleLayout()

ts
scheduleLayout(): this

Defined in: src/typescript/lib/core/Component.ts:3086

Queues a layout pass to run on the next animation frame. Multiple calls within the same frame coalesce into a single doLayout() call; if an ancestor is also scheduled, the ancestor's recursion subsumes this component and its scheduled pass is skipped.

Returns

this

This component, for method chaining.

Remarks

Honors pauseLayout(). Callers that need a synchronous layout commit (e.g. before reading getInnerSize) should call flushLayout() instead.

Inherited from

Text.scheduleLayout


setAnimation()

ts
setAnimation(value: string): this

Defined in: src/typescript/lib/core/Component.ts:2252

Sets the CSS animation shorthand on the component's CSS rule.

Parameters

value

string

A CSS animation shorthand (e.g. "ts-ui-spin 0.8s linear infinite").

Returns

this

This component, for method chaining.

Inherited from

Text.setAnimation


setAppearance()

ts
setAppearance(value: string): this

Defined in: src/typescript/lib/core/Component.ts:1298

Sets the CSS appearance on the element. Use clearAppearance to remove.

Parameters

value

string

A CSS appearance value (e.g. "none", "auto").

Returns

this

This component, for method chaining.

Inherited from

Text.setAppearance


setAttribute()

ts
setAttribute(key: string, value: string): this

Defined in: src/typescript/lib/core/Component.ts:708

Stores a component-level attribute and mirrors it onto the DOM element.

Parameters

key

string

The attribute name.

value

string

The attribute value. Passing null delegates to delAttribute.

Returns

this

Inherited from

Text.setAttribute


setAutoCommitStyle()

ts
setAutoCommitStyle(value: boolean): this

Defined in: src/typescript/lib/core/Component.ts:588

Enables or disables auto-commit; flushing all pending style and CSS rule changes when re-enabled.

Parameters

value

boolean

True to enable immediate commits; false to batch changes until manually flushed.

Returns

this

Inherited from

Text.setAutoCommitStyle


setAutoMeasure()

ts
setAutoMeasure(enabled: boolean): this

Defined in: src/typescript/lib/component/input/Text.ts:391

Enables or disables automatic text measurement on setText.

Parameters

enabled

boolean

When false, setText skips the off-screen probe and leaves preferred size and baseline unchanged. Use only when the parent layout (e.g. Fit) sizes this Text from the container, so the measured preferred size is unused.

Returns

this

This component, for method chaining.

Inherited from

Text.setAutoMeasure


setBackgroundColor()

ts
setBackgroundColor(backgroundColor: string): this

Defined in: src/typescript/lib/core/Component.ts:934

Sets the background color CSS property. Use clearBackgroundColor to inherit.

Parameters

backgroundColor

string

A CSS color string.

Returns

this

This component, for method chaining.

Inherited from

Text.setBackgroundColor


setBackgroundImage()

ts
setBackgroundImage(backgroundImage: string): this

Defined in: src/typescript/lib/core/Component.ts:977

Sets the CSS background-image property. Use clearBackgroundImage to remove.

Parameters

backgroundImage

string

A CSS background-image string.

Returns

this

This component, for method chaining.

Inherited from

Text.setBackgroundImage


setBorder()

ts
setBorder(options: 
  | string
  | BorderOptions): this

Defined in: src/typescript/lib/core/Component.ts:1101

Creates and applies a border from options.

Parameters

options

Border configuration (style, width, color), or a CSS border shorthand string. Use clearBorder to clear the border explicitly.

string | BorderOptions

Returns

this

This component, for method chaining.

Inherited from

Text.setBorder


setBorderImage()

ts
setBorderImage(value: string): this

Defined in: src/typescript/lib/core/Component.ts:1341

Sets the CSS border-image shorthand on the element. Use clearBorderImage to remove.

Parameters

value

string

A CSS border-image value (e.g. "none").

Returns

this

This component, for method chaining.

Inherited from

Text.setBorderImage


setBorderRadius()

ts
setBorderRadius(borderRadius: string): this

Defined in: src/typescript/lib/core/Component.ts:1183

Sets the CSS border-radius on the element. Use clearBorderRadius to remove.

Parameters

borderRadius

string

A CSS border-radius string (e.g. "4px").

Returns

this

This component, for method chaining.

Inherited from

Text.setBorderRadius


setColorScheme()

ts
setColorScheme(colorScheme: string): this

Defined in: src/typescript/lib/core/Component.ts:1046

Parameters

colorScheme

string

Returns

this

This component, for method chaining.

Inherited from

Text.setColorScheme


setContain()

ts
setContain(value: string): this

Defined in: src/typescript/lib/core/Component.ts:2209

Sets the CSS contain property on the component's CSS rule. Hints the rendering engine that descendants are isolated from external layout/paint.

Parameters

value

string

A CSS contain value (e.g. "layout", "strict", "layout paint").

Returns

this

This component, for method chaining.

Inherited from

Text.setContain


setCursor()

ts
setCursor(cursor: string): this

Defined in: src/typescript/lib/core/Component.ts:1141

Sets the CSS cursor style on the element.

Parameters

cursor

string

A CSS cursor value (e.g. "pointer", "text", "default").

Returns

this

This component, for method chaining.

Inherited from

Text.setCursor


setDisabledAttribute()

ts
setDisabledAttribute(value: boolean): this

Defined in: src/typescript/lib/core/Component.ts:2298

Sets the HTML disabled attribute on the underlying element.

Distinct from setEnabled on input subclasses, which carries semantic + ARIA + visual state. This setter only toggles the HTML attribute.

Parameters

value

boolean

True to add disabled, false to remove it.

Returns

this

This component, for method chaining.

Inherited from

Text.setDisabledAttribute


setDisplay()

ts
setDisplay(value: string): this

Defined in: src/typescript/lib/core/Component.ts:2037

Sets the CSS display mode (e.g. "grid", "flex", "inline-block").

Updates the cached display so that setDisplayed restores the correct mode when toggling visibility, and writes through to the per-component CSS rule.

Parameters

value

string

A valid CSS display value.

Returns

this

This component, for method chaining.

Inherited from

Text.setDisplay


setDisplayed()

ts
setDisplayed(value: boolean): this

Defined in: src/typescript/lib/core/Component.ts:812

Shows or hides the component using CSS display; hidden components take no space.

Parameters

value

boolean

True to show the component, false to set display to "none".

Returns

this

This component, for method chaining.

Inherited from

Text.setDisplayed


setFontFamily()

ts
setFontFamily(value: string): this

Defined in: src/typescript/lib/component/input/Text.ts:477

Sets the CSS font-family, updates the rule, and recalculates preferred size.

Parameters

value

string

The CSS font-family string (e.g. "sans-serif", "'Arial', sans-serif").

Returns

this

This component, for method chaining.

Inherited from

Text.setFontFamily


setFontKerning()

ts
setFontKerning(value: string): this

Defined in: src/typescript/lib/component/input/Text.ts:504

Sets the CSS font-kerning and updates the component's CSS rule.

Parameters

value

string

A CSS font-kerning value (e.g. "auto", "normal", "none").

Returns

this

This component, for method chaining.

Inherited from

Text.setFontKerning


setFontSize()

ts
setFontSize(value: string | number): this

Defined in: src/typescript/lib/component/input/Text.ts:529

Sets the font size. Pass a number for an explicit pixel value, or a CSS variable name (e.g. "--ts-ui-header-font-size") to bind to a theme token.

Parameters

value

Pixel size as a number, or a CSS custom property name as a string.

string | number

Returns

this

This component, for method chaining.

Inherited from

Text.setFontSize


setFontSizeAdjust()

ts
setFontSizeAdjust(value: string): this

Defined in: src/typescript/lib/component/input/Text.ts:571

Sets the CSS font-size-adjust and updates the component's CSS rule.

Parameters

value

string

A CSS font-size-adjust value.

Returns

this

This component, for method chaining.

Inherited from

Text.setFontSizeAdjust


setFontStretch()

ts
setFontStretch(value: string): this

Defined in: src/typescript/lib/component/input/Text.ts:595

Sets the CSS font-stretch and updates the component's CSS rule.

Parameters

value

string

A CSS font-stretch value (e.g. "normal", "condensed", "expanded").

Returns

this

This component, for method chaining.

Inherited from

Text.setFontStretch


setFontStyle()

ts
setFontStyle(value: string): this

Defined in: src/typescript/lib/component/input/Text.ts:619

Sets the CSS font-style and updates the component's CSS rule.

Parameters

value

string

A CSS font-style value (e.g. "normal", "italic", "oblique").

Returns

this

This component, for method chaining.

Inherited from

Text.setFontStyle


setFontVariant()

ts
setFontVariant(value: string): this

Defined in: src/typescript/lib/component/input/Text.ts:643

Sets the CSS font-variant and updates the component's CSS rule.

Parameters

value

string

A CSS font-variant value (e.g. "normal", "small-caps").

Returns

this

This component, for method chaining.

Inherited from

Text.setFontVariant


setFontWeight()

ts
setFontWeight(value: string): this

Defined in: src/typescript/lib/component/input/Text.ts:667

Sets the CSS font-weight, updates the rule, and recalculates preferred size.

Parameters

value

string

A CSS font-weight value (e.g. "normal", "bold", "700").

Returns

this

This component, for method chaining.

Inherited from

Text.setFontWeight


setForegroundColor()

ts
setForegroundColor(foregroundColor: string): this

Defined in: src/typescript/lib/core/Component.ts:1012

Sets the CSS color (text color). Use clearForegroundColor to inherit.

Parameters

foregroundColor

string

A CSS color string.

Returns

this

This component, for method chaining.

Inherited from

Text.setForegroundColor


setHeight()

ts
setHeight(height: number): this

Defined in: src/typescript/lib/core/Component.ts:1860

Sets the component height and updates the DOM element's inline style.

Parameters

height

number

The new height in pixels.

Returns

this

This component, for method chaining.

Inherited from

Text.setHeight


setId()

ts
setId(id: string): this

Defined in: src/typescript/lib/core/Component.ts:678

Sets the component ID and updates the DOM element's id attribute if the element exists.

Parameters

id

string

The new unique identifier for this component.

Returns

this

Inherited from

Text.setId


setInsets()

ts
setInsets(insets: Insets): this

Defined in: src/typescript/lib/core/Component.ts:846

Sets the component's insets. Use clearInsets to reset to zero.

Parameters

insets

Insets

The new Insets.

Returns

this

This component, for method chaining.

Inherited from

Text.setInsets


setLayoutConstraints()

ts
setLayoutConstraints(component: Component, constraints?: LayoutConstraints): 
  | undefined
  | LayoutConstraints

Defined in: src/typescript/lib/core/Component.ts:2950

Registers layout constraints for a child component with the layout manager.

Parameters

component

Component

The child component to constrain.

constraints?

LayoutConstraints

Optional. The layout constraints to apply.

Returns

| undefined | LayoutConstraints

Inherited from

Text.setLayoutConstraints


setLayoutManager()

ts
setLayoutManager(layoutManager: LayoutManager): this

Defined in: src/typescript/lib/core/Component.ts:2990

Detaches the current layout manager, attaches the new one, and stores the class name as an attribute.

Parameters

layoutManager

LayoutManager

The new LayoutManager to use for this component.

Returns

this

Inherited from

Text.setLayoutManager


setLineClamp()

ts
setLineClamp(lines: number): this

Defined in: src/typescript/lib/component/input/Text.ts:828

Clamps the rendered text to a maximum line count via CSS line-clamp.

Writes display: -webkit-box, -webkit-box-orient: vertical, -webkit-line-clamp, overflow: hidden, and text-overflow: ellipsis in a single call. Use clearLineClamp to remove the clamp.

Parameters

lines

number

The maximum number of lines to display before the ellipsis.

Returns

this

This component, for method chaining.

Inherited from

Text.setLineClamp


setLineHeight()

ts
setLineHeight(value: string | number): this

Defined in: src/typescript/lib/component/input/Text.ts:698

Sets the line height. Pass a number for an explicit pixel value (which stops tracking the theme), or a CSS variable name (e.g. "--ts-ui-line-height") to bind to a theme token. Theme tokens are interpreted as unitless multipliers of the current font size, so they scale automatically when the font size changes.

Parameters

value

Pixel value as a number, or a CSS custom property name as a string.

string | number

Returns

this

This component, for method chaining.

Inherited from

Text.setLineHeight


setMaxSize()

ts
setMaxSize(width: number, height: number): this

Defined in: src/typescript/lib/core/Component.ts:1575

Sets the maximum size and applies it to the CSS rule.

Parameters

width

number

The maximum width in pixels. Pass Number.MAX_VALUE to remove the constraint.

height

number

The maximum height in pixels. Pass Number.MAX_VALUE to remove the constraint.

Returns

this

This component, for method chaining.

Inherited from

Text.setMaxSize


setMinSize()

ts
setMinSize(width: number, height: number): this

Defined in: src/typescript/lib/core/Component.ts:1508

Sets the minimum size and applies it to the CSS rule.

Parameters

width

number

The minimum width in pixels.

height

number

The minimum height in pixels.

Returns

this

This component, for method chaining.

Inherited from

Text.setMinSize


setOpacity()

ts
setOpacity(value: number): this

Defined in: src/typescript/lib/core/Component.ts:2393

Sets the CSS opacity property on the element.

Parameters

value

number

A number between 0 (fully transparent) and 1 (fully opaque). Use clearOpacity to remove the property.

Returns

this

This component, for method chaining.

Inherited from

Text.setOpacity


setOutline()

ts
setOutline(outline: string): this

Defined in: src/typescript/lib/core/Component.ts:1261

Sets the CSS outline on the element. Use clearOutline to remove.

Parameters

outline

string

A CSS outline value (e.g. "none", "2px solid blue").

Returns

this

This component, for method chaining.

Inherited from

Text.setOutline


setOverflow()

ts
setOverflow(overflow: string): this

Defined in: src/typescript/lib/core/Component.ts:2082

Sets the CSS overflow property on the component's CSS rule.

Parameters

overflow

string

A CSS overflow value (e.g. "hidden", "auto", "visible").

Returns

this

This component, for method chaining.

Inherited from

Text.setOverflow


setOverflowX()

ts
setOverflowX(value: string): this

Defined in: src/typescript/lib/core/Component.ts:2122

Sets the CSS overflow-x property on the component's CSS rule.

Parameters

value

string

A CSS overflow value (e.g. "hidden", "auto", "visible").

Returns

this

This component, for method chaining.

Inherited from

Text.setOverflowX


setOverflowY()

ts
setOverflowY(value: string): this

Defined in: src/typescript/lib/core/Component.ts:2165

Sets the CSS overflow-y property on the component's CSS rule.

Parameters

value

string

A CSS overflow value (e.g. "hidden", "auto", "visible").

Returns

this

This component, for method chaining.

Inherited from

Text.setOverflowY


setPadding()

ts
setPadding(padding: Insets): this

Defined in: src/typescript/lib/core/Component.ts:886

Sets the CSS padding. Use clearPadding to reset to "0px 0px 0px 0px".

Parameters

padding

Insets

The new padding Insets.

Returns

this

This component, for method chaining.

Inherited from

Text.setPadding


setPointerEvents()

ts
setPointerEvents(value: string): this

Defined in: src/typescript/lib/core/Component.ts:2352

Sets the CSS pointer-events property on the element.

Parameters

value

string

A CSS pointer-events value (e.g. "none", "auto").

Returns

this

This component, for method chaining.

Inherited from

Text.setPointerEvents


setPosition()

ts
setPosition(position: Position): this

Defined in: src/typescript/lib/core/Component.ts:2004

Sets the CSS position mode and updates the component's CSS rule.

Parameters

position

Position

The CSS position mode to apply (e.g. Position.ABSOLUTE, Position.STATIC).

Returns

this

This component, for method chaining.

Inherited from

Text.setPosition


setPreferredSize()

ts
setPreferredSize(width: number, height: number): this

Defined in: src/typescript/lib/component/input/Text.ts:245

Sets the preferred size from an explicit caller, locking it against automatic recalculation.

Parameters

width

number

height

number

Returns

this

This component, for method chaining.

Inherited from

Text.setPreferredSize


setShadow()

ts
setShadow(shadow: string): this

Defined in: src/typescript/lib/core/Component.ts:1224

Sets the CSS box-shadow. Use clearShadow to set the shadow to "none".

Parameters

shadow

string

A CSS box-shadow string.

Returns

this

This component, for method chaining.

Inherited from

Text.setShadow


setSize()

ts
setSize(size: Size): this

Defined in: src/typescript/lib/core/Component.ts:1782

Sets width and height, updates the DOM element, and triggers doLayout.

Parameters

size

Size

The new Size with width and height in pixels.

Returns

this

This component, for method chaining.

Inherited from

Text.setSize


setText()

ts
setText(text: String): this

Defined in: src/typescript/lib/component/input/Text.ts:365

Sets the text content, recalculates the preferred size, and updates the DOM element.

Parameters

text

String

The new text to display.

Returns

this

This component, for method chaining.

Inherited from

Text.setText


setTextAlign()

ts
setTextAlign(align: string): this

Defined in: src/typescript/lib/component/input/Text.ts:413

Sets the CSS text-align and updates the component's CSS rule.

Parameters

align

string

A CSS text-align value (e.g. "left", "center", "right").

Returns

this

This component, for method chaining.

Inherited from

Text.setTextAlign


setTextOverflow()

ts
setTextOverflow(value: string): this

Defined in: src/typescript/lib/component/input/Text.ts:757

Sets the CSS text-overflow property and updates the component's CSS rule.

Parameters

value

string

A CSS text-overflow value (e.g. "clip", "ellipsis").

Returns

this

This component, for method chaining.

Inherited from

Text.setTextOverflow


setTextShadow()

ts
setTextShadow(shadow: string): this

Defined in: src/typescript/lib/component/input/Text.ts:437

Sets the CSS text-shadow and updates the component's CSS rule.

Parameters

shadow

string

A CSS text-shadow value.

Returns

this

This component, for method chaining.

Inherited from

Text.setTextShadow


setTransform()

ts
setTransform(value: string): this

Defined in: src/typescript/lib/core/Component.ts:1384

Sets the CSS transform on the element. Use clearTransform to remove.

Parameters

value

string

A CSS transform value (e.g. "translateY(-1px)").

Returns

this

This component, for method chaining.

Inherited from

Text.setTransform


setTranslate()

ts
setTranslate(x: number, y: number): this

Defined in: src/typescript/lib/core/Component.ts:1971

Writes the element's transform to translate3d(x, y, 0). This positions on the compositor without triggering layout/paint, complementing setX/setY (left/top). Visual position of the element is left + translateX, top + translateY.

Parameters

x

number

Translate-X in pixels.

y

number

Translate-Y in pixels.

Returns

this

This component, for method chaining.

Inherited from

Text.setTranslate


setUserSelect()

ts
setUserSelect(value: string): this

Defined in: src/typescript/lib/core/Component.ts:2513

Sets the CSS user-select property on the element.

Parameters

value

string

A CSS user-select value (e.g. "none", "auto", "text").

Returns

this

This component, for method chaining.

Inherited from

Text.setUserSelect


setVerticalAlign()

ts
setVerticalAlign(align: string): this

Defined in: src/typescript/lib/core/Component.ts:1725

Parameters

align

string

Returns

this

This component, for method chaining.

Inherited from

Text.setVerticalAlign


setVisible()

ts
setVisible(value: Boolean): this

Defined in: src/typescript/lib/core/Component.ts:749

Sets visibility; true = visible, false = hidden, null/falsy = inherit from parent.

Parameters

value

Boolean

True to show the component, false to hide it, or a falsy non-boolean to inherit.

Returns

this

Remarks

Throws an Error if value is a non-boolean truthy value.

Inherited from

Text.setVisible


setWhiteSpace()

ts
setWhiteSpace(value: string): this

Defined in: src/typescript/lib/core/Component.ts:2472

Sets the CSS white-space property on the component's CSS rule.

Parameters

value

string

A CSS white-space value (e.g. "nowrap", "normal", "pre").

Returns

this

This component, for method chaining.

Remarks

Previously declared on Text; promoted to Component because the property has no Text-specific semantics. The _whiteSpace backing field that applyStyle already consults on re-render lives here, so caching during the setter call keeps the post-render state in lockstep with the cached value.

Inherited from

Text.setWhiteSpace


setWidth()

ts
setWidth(width: number): this

Defined in: src/typescript/lib/core/Component.ts:1822

Sets the component width and updates the DOM element's inline style.

Parameters

width

number

The new width in pixels.

Returns

this

This component, for method chaining.

Inherited from

Text.setWidth


setWillChange()

ts
setWillChange(value: null | string): this

Defined in: src/typescript/lib/core/Component.ts:2437

Sets the CSS will-change hint on the element, pre-promoting it to its own compositor layer so the first transform/scroll frame doesn't pay a layer-creation cost. Pass null to clear the hint and release the layer.

Parameters

value

A CSS will-change value (e.g. "transform") or null to clear.

null | string

Returns

this

This component, for method chaining.

Remarks

The hint costs GPU memory and is ignored by browsers past a per-page threshold (~50–100 elements). Set it only over the active-motion lifetime (drag, pool membership, scroll-target lifetime) and clear it promptly when motion ends.

Inherited from

Text.setWillChange


setWordBreak()

ts
setWordBreak(value: string): this

Defined in: src/typescript/lib/component/input/Text.ts:797

Sets the CSS word-break property on the component's CSS rule.

Parameters

value

string

A CSS word-break value (e.g. "break-word", "normal", "keep-all").

Returns

this

This component, for method chaining.

Inherited from

Text.setWordBreak


setX()

ts
setX(x: number): this

Defined in: src/typescript/lib/core/Component.ts:1893

Sets the CSS left position and updates the DOM element's inline style.

Parameters

x

number

The horizontal offset in pixels.

Returns

this

This component, for method chaining.

Inherited from

Text.setX


setY()

ts
setY(y: number): this

Defined in: src/typescript/lib/core/Component.ts:1926

Sets the CSS top position and updates the DOM element's inline style.

Parameters

y

number

The vertical offset in pixels.

Returns

this

This component, for method chaining.

Inherited from

Text.setY


setZIndex()

ts
setZIndex(value: number): this

Defined in: src/typescript/lib/core/Component.ts:781

Sets the CSS z-index of the component.

Parameters

value

number

The z-index value.

Returns

this

Inherited from

Text.setZIndex


sortComponents()

ts
sortComponents(comparator: 
  | undefined
  | Comparator<Component<ComponentOptions>, Component<ComponentOptions>>): this

Defined in: src/typescript/lib/core/Component.ts:2912

Sorts the children array in place using the given comparator function.

Parameters

comparator

Optional. A comparator function that receives two Components and returns a number.

undefined | Comparator<Component<ComponentOptions>, Component<ComponentOptions>>

Returns

this

This component, for method chaining.

Inherited from

Text.sortComponents


sync()

ts
sync(): void

Defined in: src/typescript/lib/core/Component.ts:2721

Re-applies all styles to the existing DOM element, syncing state after external changes.

Returns

void

Inherited from

Text.sync


unfocus()

ts
unfocus(): this

Defined in: src/typescript/lib/core/Component.ts:2559

Removes browser focus from this component's DOM element.

Returns

this

This component, for method chaining.

Inherited from

Text.unfocus