Skip to content

@jsvision/ui / TrackItem

Type Alias: TrackItem

TrackItem = { kind: "fixed"; size: number; } | { kind: "flex"; min?: number; weight: number; }

Defined in: ui/src/layout/apportion.ts:18

A single item along a 1-D flex track: either a fixed cell count or a flexible grow-weight share.

Union Members

Type Literal

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


Type Literal

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

kind

readonly kind: "flex"

min?

readonly optional min?: number

Optional floor in whole cells: this item is never solved below min, even as the container shrinks. When no item on the track carries a min, the solver runs its plain apportionment untouched (the no-min fast path), so the field is free for every existing caller. When the floors are collectively unsatisfiable — their sum exceeds the available space — every item squeezes proportionally rather than overflow the track.

weight

readonly weight: number