Skip to content

FieldViewModel

FieldViewModel = object

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

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

optional badgeShape?: BadgeShape

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

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


optional confirm?: string

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

The question a form or a list cell asks before the field’s value first changes; cancelling keeps the value.


optional currency?: string

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

The ISO 4217 code of the currency a decimal is an amount of, such as EUR: lists show it as money in that currency.


optional decimals?: number

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

How many decimals a number shows.


optional format?: FieldFormat

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

How the value is shown.


optional help?: string

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

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


optional helpWhen?: HelpWhen

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

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:424

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:390

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


optional linkText?: string

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

The text a url field’s link shows instead of the address: fixed, such as Error report, or with {{field}} placeholders filled from the record, such as {{title}}; the address shows when it comes out empty.


optional markdown?: boolean

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

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:409

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


optional notOnCreate?: true

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

Left off the create form, so a create leaves it empty or to its default; the server refuses it on a field a create needs.


optional prefix?: string

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

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


optional suffix?: string

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

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


optional valueColors?: Record<string, BadgeTone | string & object>

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

A badge tone or a hex colour per enum value, such as { paid: 'green', a: '#00a651' }; a hex colour fills the badge. A value without one is neutral.


optional valueLabels?: Record<string, string>

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

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


optional waitingValues?: string[]

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

Enum values that mark a wait rather than work, such as queued: a Timeline draws their segments striped.


optional when?: ShowWhen

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

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:441

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