Skip to content

Additional Columns

Additional columns let you display computed or derived data in the collection table without storing it in the database.

const ordersCollection: EntityCollection = {
slug: "orders",
additionalFields: [
{
key: "total_display",
name: "Total",
Builder: ({ entity }) => {
const total = entity.values.items?.reduce(
(sum, item) => sum + (item.price * item.quantity), 0
) ?? 0;
return <span>${total.toFixed(2)}</span>;
}
},
{
key: "status_badge",
name: "Status",
Builder: ({ entity }) => {
const color = entity.values.status === "completed" ? "green" : "orange";
return (
<span style={{ color }}>
{entity.values.status}
</span>
);
},
dependencies: ["status"] // Re-render when these fields change
}
],
properties: { /* ... */ }
};
PropTypeDescription
entityEntityThe entity for this row
contextRebaseContextFull Rebase context