Density modes: compact, normal and comfortable
Density adjusts row height, header height, cell padding and control sizes through tokens. Teams can fit more data on screen or provide roomier touch-friendly rows, and virtualization recalculates heights automatically.
Planned. This page shows the specification from issue #205. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A 10,000-row virtualized grid in normal density, scrolled to row 5,000.
Expected behavior
Changing density updates row and header heights. The row at the top of the viewport stays anchored, and the visible-row readout updates. Checkboxes and icons scale proportionally.
Planned API surface
density option ('compact'|'normal'|'comfortable')data-war-density attribute--war-grid-row-height token--war-grid-cell-padding-inline tokendensitychange eventAcceptance criteria
- Compact, normal and comfortable map to documented row heights (for example 28/36/48px at the default font size) (pending)
- After a density change, the first visible row index is the same as before (pending)
- Virtual scroll height is recomputed with no blank gaps (pending)
- Interactive targets in comfortable density are at least 44x44 CSS px (pending)
- Density can be set independently of theme (pending)