components/grid
Layout · 51 / 64

Grid

ui.widgets.mountGrid

Two-dimensional rows and columns with custom cells.

BEHAVIOR CONTRACT

Column widths, row heights, the scroll window and cell coordinates stay out of app nodes.

RECORDED INTERACTION

The harness scrolls the grid and the visible window updates.

examples/storybook/stories.zig:3005
pub fn buildGrid(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
    const widths = [_]f32{ 90, 90, 90, 90 };
    const g = try W.mountGrid(.{
        .col_count = 4,
        .row_count = 12,
        .col_widths = &widths,
        .cell_height = 30,
        .width = 380,
        .height = 320,
        .cell_render_fn = gridCell,
    }, scope, cx);
    return g.root;
}
View source on GitHubexamples/storybook/stories.zig:3005

The story's verbatim source from the Storybook (zenit 4c50245 2026-10-01). W is ui.widgets; col / row / label are small Storybook layout helpers.

zenit · Dual-licensedFree for open-source projects under GPL-3.0-only; closed-source or commercial products need a commercial license.Contact the author: zongyi.xzy#gmail.com (replace # with @)zenit 4c50245 2026-10-01