Skip to content

FieldViewModel

FieldViewModel = object

Defined in: packages/schema/src/model.ts:267

A view’s hints for one field (.fields((r) => ...)); see Names and columns.

optional badgeShape?: BadgeShape

Defined in: packages/schema/src/model.ts:298

arrow draws the field’s badges as arrows pointing right, as on a rating scale such as the EU energy label.


optional decimals?: number

Defined in: packages/schema/src/model.ts:287

How many decimals a number shows.


optional format?: FieldFormat

Defined in: packages/schema/src/model.ts:277

How the value is shown.


optional help?: string

Defined in: packages/schema/src/model.ts:271

A line under the field on the record page and in forms.


optional helpWhen?: HelpWhen

Defined in: packages/schema/src/model.ts:273

When help shows: always, or only while the record is edited; the view’s helpWhen when omitted.


optional icon?: string

Defined in: packages/schema/src/model.ts:292

An icon before the value on a card’s meta row and above it in a section of key facts, by the names actions take (ruler); an unknown name shows none.


optional label?: string

Defined in: packages/schema/src/model.ts:269

What the field is called, instead of its name in words.


optional markdown?: boolean

Defined in: packages/schema/src/model.ts:281

Markdown: forms edit its source with a preview, and it shows rendered, raw HTML as text.


optional multiline?: boolean

Defined in: packages/schema/src/model.ts:279

A text that runs over several lines: forms edit it in a box that grows with it, and its line breaks show.


optional prefix?: string

Defined in: packages/schema/src/model.ts:283

Text before a number wherever it is shown, such as €.


optional suffix?: string

Defined in: packages/schema/src/model.ts:285

Text after a number wherever it is shown, such as a unit: m² shows 120 m².


optional valueColors?: Record<string, string>

Defined in: packages/schema/src/model.ts:296

A hex colour per enum value that fills its badge, such as { a: '#00a651' }; a value without one keeps its tone.


optional valueLabels?: Record<string, string>

Defined in: packages/schema/src/model.ts:294

What an enum value reads as wherever it is shown; a value without one reads as itself in words (enumLabel).


optional when?: ShowWhen

Defined in: packages/schema/src/model.ts:275

When the field shows on the record page: always, the default, only on its form or only on its read view.


optional widget?: FieldWidgetModel

Defined in: packages/schema/src/model.ts:303

The field type a plugin registers (definePlugin({ fields })) that shows and edits this field, with its props; without that plugin, or for a storage type it does not show, the field shows as it would without it.