anchor([anchors])
Class: Tabs. Method inherited from UIComponent.
Description:
Sets or gets the anchor style of the component that indicates how to resize this component based on the resizing parent component.
Anchor defines which sides (top, right, bottom, left) of the component stay attached to the parent's edge when parent gets resized.
Set anchors after the component and its ancestors are added to a container to ensure expected behaviour.
Parameters:
| Name | Type | Description |
|---|---|---|
|
|
string |
Space-separated list of sides to anchor (e.g., |
Returns:
Returns this component when setting, or the current anchor string when getting value.
Type: this | string
Examples:
const txt1 = new TextArea().anchor("top left right"); // Horizontally resizable
const txt2 = new TextArea().anchor("top left bottom"); // Vertically resizable
