Lattice Grid Buy a licence

developer guide

Data Grid Row Density and Compact Mode

Density moves row height, padding and type together, from compact for as many rows as the screen will take to spacious for a room, and a single token overrides it where a design needs an exact height.

Developer guideTheming and density › Data Grid Row Density and Compact Mode

Density

One number drives the grid's geometry. A preset sets it; every token derives from it.

Four presets, or a number between them

createGrid(el, { density: 'spacious' });
createGrid(el, { density: 1.4 });   // anything between the presets
grid.set('density', 'compact');     // live
PresetScaleRowFontFor
compact0.8523.8px12.7pxThe default. Dense operational and financial grids; most rows on screen.
standard128px13pxRoomier than the default.
comfortable1.542px14pxRoomier application tables.
spacious256px15pxModern app listings with avatars and thumbnails.

Type does not scale with the rows. The row doubles from compact to spacious while the font moves about 18%. Scaling text against row height reads as a children's book long before the rows look generous, so height and spacing follow the scale directly and type is damped against it.

Virtualisation follows the token, not a separate number. Row positions are computed from the resolved --lattice-row-height, so a host that overrides that token by hand gets the virtualisation to agree. An explicit rowHeight in config outranks both, a host that names a number means it.

Height alone will not reproduce a modern app listing. Those designs pair generous rows with two-line cells (a bold title over a grey sub-label) and an avatar or thumbnail. spacious gives the room, an image column gives the picture, and twoline gives the second line.