Skip to content

fieldForColumn

fieldForColumn(column): FieldComponent

Defined in: packages/ui/src/fields/field-for-column.ts:38

Maps a Drizzle column’s metadata to the appropriate TypedField component.

Inspects the column’s dataType and name to determine the best display component. The mapping follows these rules:

ColumnMeta

Drizzle column metadata with dataType and name properties.

FieldComponent

A React component suitable for displaying the column’s values.

import { fieldForColumn } from "@cfast/ui";
const Field = fieldForColumn({ dataType: "timestamp", name: "createdAt" });
// Field === DateField