Grid layout for structured dashboards and forms.
import { Grid } from 'nikcli-tui';
new Grid({ parent: screen, rows: 2, cols: 3, gap: 1 });
npm run tsx:core-gallery
npm i nikcli-tui
import { Grid, Box, Text } from 'nikcli-tui';
const grid = new Grid({ parent: screen, top: 1, left: 2, width: 60, height: 12, columns: 3, rows: 2, gap: 1, borderStyle: 'line' }); new Text({ parent: grid.el, content: 'A' }); new Text({ parent: grid.el, content: 'B' }); new Text({ parent: grid.el, content: 'C' }); grid.reflow();
const cell = new Box({ parent: screen, width: 10, height: 3, borderStyle: 'line', label: 'X' }).el; grid.addChildAt(cell, 1, 1);
grid.setDimensions(4, 3); expect(grid.getConfig).toBeDefined();
width/height