← @mortar-kit/core

FieldInfointerface

import { FieldInfo } from '@mortar-kit/core'

interface FieldInfo

UI description of a field, stored in its Valibot metadata under mortar.

Properties

readonly kind: FieldKind
readonly label: string
readonly help?: string
readonly placeholder?: string
readonly required?: boolean

Text-like fields: the value must not be empty.

readonly maxLength?: number

Text-like fields: maximum length.

readonly options?: Readonly<Record<string, string>>

select: option value → option label.

readonly min?: number

number: input constraints.

readonly max?: number
readonly step?: number
readonly item?: AnyField

list: the field each item is edited with.

readonly fields?: Readonly<Record<string, AnyField>>

object: the nested fields.

readonly collection?: string

reference: the name of the collection whose documents it points to.

readonly accept?: readonly AssetKind[]

image and file: the kinds of uploaded file it accepts.

readonly private?: boolean

Kept out of the browser on public pages (see Common.private).