demo D113
Terminal
A phosphor console: one hue, monospaced, status by brightness
theme: 'terminal'
The configuration
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.13.0/lattice-grid.min.css">
<script src="https://cdn.jsdelivr.net/npm/@toclocoinc/lattice-grid@1.13.0/lattice-grid.min.js"></script>
<div id="grid" style="height: 540px"></div>
<script>
const grid = LatticeGrid.createGrid(document.getElementById('grid'), {
rowKey: 'id',
selection: 'multiple',
theme: 'terminal',
columns: [
{ field: 'service', title: 'Service', layout: { pin: 'start', width: 140 } },
{ field: 'team', title: 'Team', filter: { type: 'set' } },
{ field: 'owner', title: 'Owner', filter: { type: 'set' } },
{ field: 'tier', title: 'Tier', cell: { decoration: 'pill', variant: { map: { gold: 'warning', silver: 'neutral', bronze: 'info' } } } },
{ field: 'state', title: 'State', cell: { decoration: 'dot', variant: { map: { healthy: 'success', degraded: 'warning', failing: 'danger', unknown: 'neutral' } } } },
{ field: 'region', title: 'Region', filter: { type: 'set' } },
{ field: 'active', title: 'Active', type: 'boolean' },
{ field: 'deprecated', title: 'Deprecated', type: 'boolean' },
{ field: 'version', title: 'Version', layout: { width: 100 } },
],
rows, // 5,000 service records
});
</script>
A monochrome terminal theme for a JavaScript data grid
The terminal theme strips colour down to a single hue on a dark background, rendering text, borders and status indicators as shades of one phosphor green (or amber, or white, depending on the palette chosen) rather than a mixed colour scale. Reach for it when a Lattice Grid instance sits inside a console-style tool, a log viewer, or any interface built to evoke a command-line session, where a conventional light-and-shade UI theme would clash with the surrounding chrome. Row state, sort direction and validation errors are still legible: instead of red and green, the theme encodes them as brightness steps, so a flagged row sits at full intensity while a muted or disabled one recedes toward the background. Set theme: 'terminal' to switch a grid over; the option takes effect immediately and does not require re-mounting the grid or reloading its data.
Because every element draws from one hue, the theme keeps contrast ratios stable across the interface: headers, focus rings and hover states each get their own brightness step, so the relationships between them hold even when a display’s saturation changes. Fonts render monospaced by default, matching a terminal-style layout and keeping numeric columns aligned without extra width padding. Switching themes is a style change only; row data, sort order and column widths carry over unaffected.
How do I make a JavaScript data grid look like a terminal?
Set the theme option to 'terminal' when creating the grid, or apply it later with the same property. The theme swaps colours and fonts for a single-hue, monospaced palette while leaving row data, sorting and column layout untouched, so it can be toggled alongside other themes without rebuilding the grid.