Skip to content

FieldProps

@firecms/core


@firecms/core / FieldProps

Defined in: types/fields.tsx:12

When building a custom field you need to create a React component that takes this interface as props.

T extends CMSType = any

CustomProps = any

M extends Record<string, any> = any

optional autoFocus: boolean

Defined in: types/fields.tsx:93

Should this field autofocus on mount


context: FormContext<M>

Defined in: types/fields.tsx:103

Additional values related to the state of the form or the entity


customProps: CustomProps

Defined in: types/fields.tsx:98

Additional properties set by the developer


optional disabled: boolean

Defined in: types/fields.tsx:108

Flag to indicate if this field should be disabled


optional error: any

Defined in: types/fields.tsx:56

Is there an error in this field. The error field has the same shape as the field, replacing values with a string containing the error. It takes the value null if there is no error


optional includeDescription: boolean

Defined in: types/fields.tsx:71

Should this field include a description


optional isSubmitting: boolean

Defined in: types/fields.tsx:41

Is the form currently submitting


optional minimalistView: boolean

Defined in: types/fields.tsx:88

Display the child properties directly, without being wrapped in an extendable panel. Note that this will also hide the title of this property.


optional onPropertyChange: (property) => void

Defined in: types/fields.tsx:122

Some properties might change internal state (like expanding a panel). This function should be called when the internal state changes. This is used to preserve state in array containers.

Partial<ArrayProperty<any, any> | MapProperty<any> | AnyProperty>

void


optional partOfArray: boolean

Defined in: types/fields.tsx:82

Is this field part of an array


property: Property<T> | ResolvedProperty<T>

Defined in: types/fields.tsx:66

Property related to this field


propertyKey: string

Defined in: types/fields.tsx:18

Key of the property E.g. “user.name” for a property with path “user.name”


setFieldValue: (propertyKey, value, shouldValidate?) => void

Defined in: types/fields.tsx:36

Set value of a different field directly

string

CMSType | null

boolean

void


setValue: (value, shouldValidate?) => void

Defined in: types/fields.tsx:28

Set value of field directly

T | null

boolean

void


optional showError: boolean

Defined in: types/fields.tsx:49

Should this field show the error indicator. Note that there might be an error (like an empty field that should be filled) but we don’t want to show the error until the user has tried saving.


optional size: "small" | "medium" | "large"

Defined in: types/fields.tsx:113

Size of the field


optional touched: boolean

Defined in: types/fields.tsx:61

Has this field been touched


optional underlyingValueHasChanged: boolean

Defined in: types/fields.tsx:77

Flag to indicate that the underlying value has been updated in the datasource


value: T

Defined in: types/fields.tsx:23

Current value of this field