DetailList#

Aligned label/value pairs — the detail pane beside a table, or the header block of a status screen.

Import#

TSX
import { DetailList } from '@sigx/terminal';

Usage#

TSX
<DetailList
    rows={[
        { label: 'Host', value: silo.host },
        { label: 'Activations', value: String(silo.activations) },
        { label: 'p99', value: `${silo.p99}ms`, tone: silo.p99 > 500 ? 'danger' : undefined },
    ]}
/>

Labels are fitted to one width so the values form a column. That alignment is the only reason to reach for this over hand-written text — and it is measured in display cells, so a label containing wide glyphs still lines up.

Props#

PropTypeNotes
rowsDetailRow[]required{ label, value, tone? }; tone is a theme token, e.g. danger for a figure out of range
labelWidthnumberfix the label column instead of measuring
alignCellAlignvalue alignment
gapnumberspace between the columns

See also#

  • DataTable — the table this often sits beside.