Skip to content

@jsvision/ui / Size

Type Alias: Size

Size = { cells: number; kind: "fixed"; } | { kind: "fr"; min?: number; weight: number; } | { kind: "auto"; }

Defined in: ui/src/layout/types.ts:36

How a box is sized along its parent's main axis.

Union Members

Type Literal

{ cells: number; kind: "fixed"; }


Type Literal

{ kind: "fr"; min?: number; weight: number; }

kind

kind: "fr"

min?

optional min?: number

Optional floor in whole cells: an fr box never sizes below this, and it reserves the floor even inside a shrink-to-fit (auto) parent. Omitted ⇒ no floor — identical to the pre-existing behaviour. A negative value clamps to 0 in normalizeSize.

weight

weight: number


Type Literal

{ kind: "auto"; }