Documentation
Concepts

Layout items

What an item of the layout holds, how a layout is checked and corrected, and how to hold it controlled or not.

An item is a plain object in grid units.

fieldwhat it is
idunique in the layout
x, yits first column (from the inline-start edge) and row
w, hits width in columns and height in rows
minW, maxW, minH, maxHthe sizes a resize may reach
staticit never moves, by a person or by compaction
draggable, resizablefalse to keep people from dragging or resizing it

Checked and corrected

Any layout the grid is given is checked, then corrected and settled: an item past the last column moves back in, one left of the first moves in keeping its width, sizes come back within their limits, overlapping statics move apart, and y: Infinity means "below everything before it". A layout that cannot be used (a duplicated id, a size of zero) is refused with what is wrong.

Controlled or not

defaultLayout is where the grid starts, and the grid keeps the changes. layout with onLayoutChange keeps the layout in your state: the grid shows yours, and a change you do not take back is undone.

onLayoutChange is told once per committed change, never during a gesture, and on mount only when the layout you gave had to be corrected.

Add and remove
Gallery