Skip to main content
Version: 3.0.0-beta

Interface: FieldProps<T, CustomProps, M>

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

Type Parameters​

• T extends CMSType = any

• CustomProps = any

• M extends Record<string, any> = any

Properties​

autoFocus?​

optional autoFocus: boolean

Should this field autofocus on mount

Defined in​

packages/firecms_core/src/types/fields.tsx:91


context​

context: FormContext<M>

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

Defined in​

packages/firecms_core/src/types/fields.tsx:101


customProps​

customProps: CustomProps

Additional properties set by the developer

Defined in​

packages/firecms_core/src/types/fields.tsx:96


disabled?​

optional disabled: boolean

Flag to indicate if this field should be disabled

Defined in​

packages/firecms_core/src/types/fields.tsx:106


error?​

optional error: any

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

Defined in​

packages/firecms_core/src/types/fields.tsx:55


includeDescription?​

optional includeDescription: boolean

Should this field include a description

Defined in​

packages/firecms_core/src/types/fields.tsx:70


isSubmitting?​

optional isSubmitting: boolean

Is the form currently submitting

Defined in​

packages/firecms_core/src/types/fields.tsx:40


minimalistView?​

optional minimalistView: boolean

Should this field render with the minimal amount of UI elements

Defined in​

packages/firecms_core/src/types/fields.tsx:86


onPropertyChange()?​

optional onPropertyChange: (property) => void

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.

Parameters​

• property: Partial<ArrayProperty<any, any> | MapProperty<any> | AnyProperty>

Returns​

void

Defined in​

packages/firecms_core/src/types/fields.tsx:120


partOfArray?​

optional partOfArray: boolean

Is this field part of an array

Defined in​

packages/firecms_core/src/types/fields.tsx:81


property​

property: Property<T> | ResolvedProperty<T>

Property related to this field

Defined in​

packages/firecms_core/src/types/fields.tsx:65


propertyKey​

propertyKey: string

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

Defined in​

packages/firecms_core/src/types/fields.tsx:17


setFieldValue()​

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

Set value of a different field directly

Parameters​

• propertyKey: string

• value: CMSType

• shouldValidate?: boolean

Returns​

void

Defined in​

packages/firecms_core/src/types/fields.tsx:35


setValue()​

setValue: (value, shouldValidate?) => void

Set value of field directly

Parameters​

• value: T

• shouldValidate?: boolean

Returns​

void

Defined in​

packages/firecms_core/src/types/fields.tsx:27


showError?​

optional showError: boolean

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.

Defined in​

packages/firecms_core/src/types/fields.tsx:48


size?​

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

Size of the field

Defined in​

packages/firecms_core/src/types/fields.tsx:111


touched?​

optional touched: boolean

Has this field been touched

Defined in​

packages/firecms_core/src/types/fields.tsx:60


underlyingValueHasChanged?​

optional underlyingValueHasChanged: boolean

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

Defined in​

packages/firecms_core/src/types/fields.tsx:76


value​

value: T

Current value of this field

Defined in​

packages/firecms_core/src/types/fields.tsx:22

Sign up to our newsletter to get the latest news and updates. No spam!