middag-react
    Preparing search index...

    Interface DataTableColumn<TData>

    interface DataTableColumn<TData> {
        entityIdField?: string;
        entityType?: string;
        hideable?: boolean;
        href?: string;
        key: string;
        label: string;
        minWidth?: number;
        render?: (value: unknown, row: TData) => ReactNode;
        sortable?: boolean;
        statusMap?: Record<
            string,
            "secondary"
            | "success"
            | "warning"
            | "info"
            | "default"
            | "destructive",
        >;
        timestampFormat?: TimestampFormat;
        type?: DataTableCellType;
        visible?: boolean;
        width?: number;
    }

    Type Parameters

    • TData
    Index

    Properties

    entityIdField?: string

    Field name in row data containing the entity ID.

    entityType?: string

    Entity type for link resolution (from PageContract.entities map).

    hideable?: boolean

    Whether the column can be hidden via column visibility. Defaults to true.

    href?: string

    URL pattern for link cells. Interpolated per row (e.g. "/organizations/{organizationId}").

    key: string

    Unique column key, must match a property of TData (or use render for computed).

    label: string

    Header label text.

    minWidth?: number

    Min width in pixels.

    render?: (value: unknown, row: TData) => ReactNode

    Custom cell renderer. Overrides type-based rendering.

    sortable?: boolean

    Whether the column is sortable. Defaults to false.

    statusMap?: Record<
        string,
        "secondary"
        | "success"
        | "warning"
        | "info"
        | "default"
        | "destructive",
    >

    Status-to-semantic mapping for type="status" columns. Maps status string to a semantic intent.

    timestampFormat?: TimestampFormat

    Display format for type="timestamp" columns. Defaults to "relative".

    Cell type — controls default rendering. Defaults to "text".

    visible?: boolean

    Whether the column is visible by default. Defaults to true.

    width?: number

    Fixed width in pixels. When omitted, column auto-sizes.