Skip to content

1681-engine / ui / wrapRow

Function: wrapRow() ​

ts
function wrapRow(
   widths, 
   maxWidth, 
   gap?
): number[][];

Defined in: src/ui/layout/wrapRow.ts:5

Breaks a row of items (tabs, chips, buttons) into lines no wider than maxWidth: each line holds the indices of its items in order. An item wider than the line still gets a line of its own rather than being dropped.

Parameters ​

ParameterTypeDefault value
widthsreadonly number[]undefined
maxWidthnumberundefined
gapnumber0

Returns ​

number[][]

Released under the MIT License.