demo D113
Terminal in Web Component
A phosphor console: one hue, monospaced, status by brightness
theme: 'terminal'
This grid renders as a phosphor console: a single hue on a dark background, monospaced, with status shown by brightness rather than colour. It suits an operations or terminal aesthetic, proving the theme system reaches well beyond light and dark.
This is the web component version. A lattice-grid custom element renders the grid with no build step, its configuration set as a property, so it works on a page that has no bundler at all.
The configuration
<link rel="stylesheet" href="https://cdn.latticegrid.dev/lattice-grid@1.107.0/lattice-grid.min.css">
<script type="module">
import { defineLatticeGrid } from 'https://cdn.latticegrid.dev/lattice-grid@1.107.0/modules/webcomponent.esm.min.js';
defineLatticeGrid();
</script>
<!-- One setting restyles the whole grid. This is a built-in theme; swap
the value for another built-in name to change every part of the table
at once. -->
<lattice-grid row-key="id" theme="terminal" selection="multiple" style="display: block; height: 540px"></lattice-grid>
<script type="module">
const grid = document.querySelector('lattice-grid');
grid.config = {
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 } },
],
};
grid.rows = 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.