Skip to content

ColumnShorthand

ColumnShorthand<T> = string | ColumnDef<T>

Defined in: packages/ui/src/types.ts:420

Column definition shorthand: either a plain column key string or a full ColumnDef.

When a string is provided, the label is auto-derived from the key (e.g., "createdAt" becomes “Created At”) and column behavior (sorting, rendering) is inferred from the Drizzle schema column type.

T = unknown

The row object type, forwarded to ColumnDef for type-safe rendering.

// Mix strings and full definitions:
const columns: ColumnShorthand<Post>[] = [
"title",
{ key: "author", label: "Written by" },
{ key: "createdAt", sortable: false },
];