blessed-components - v1.20.0
    Preparing search index...

    Interface DataTableColumn<TRow>

    Column definition consumed by renderDataTable.

    interface DataTableColumn<TRow extends TableRow = TableRow> {
        filterable?: boolean;
        sortable?: boolean;
        sortAccessor?: (row: TRow) => string | number;
        align?: TableColumnAlign;
        accessor?: (row: TRow) => string | number;
        header: string;
        id: string;
        width?: number | "auto";
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    filterable?: boolean

    Whether this column is matched against query.

    true

    sortable?: boolean

    Whether this column may be sorted.

    false

    sortAccessor?: (row: TRow) => string | number

    Value used for sorting. Falls back to accessor.

    Cell alignment.

    accessor?: (row: TRow) => string | number

    Returns the display value for this column. Defaults to row[id].

    header: string

    Header text displayed above body rows.

    id: string

    Stable column identifier.

    width?: number | "auto"

    Preferred width in terminal cells.

    Numeric widths are fixed. auto shares remaining space with other auto columns.

    'auto'