Files
firecms/website/docs/api/interfaces/fieldprops.md
2021-06-06 13:36:47 +02:00

5.2 KiB

id, title, sidebar_label, sidebar_position, custom_edit_url
id title sidebar_label sidebar_position custom_edit_url
fieldprops Interface: FieldProps<T, CustomProps, S, Key> FieldProps 0 null

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

Type parameters

Name Type
T T
CustomProps CustomProps = any
S S: EntitySchema<Key> = EntitySchema<any>
Key Key: string = Extract<keyof S["properties"], string>

Properties

CMSFormField

CMSFormField: FunctionComponent<CMSFormFieldProps<S, Key>>

Builder in case this fields needs to build additional fields, e.g. arrays or maps

Defined in

models/fields.tsx:68


autoFocus

autoFocus: boolean

Should this field autofocus on mount

Defined in

models/fields.tsx:88


context

context: FormContext<S, Key>

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

Defined in

models/fields.tsx:98


customProps

customProps: CustomProps

Additional properties set by the developer

Defined in

models/fields.tsx:93


dependsOnOtherProperties

dependsOnOtherProperties: boolean

Flag to indicate if this field was built from a property that gets rendered conditionally

Defined in

models/fields.tsx:109


disabled

disabled: boolean

Flag to indicate if this field should be disabled

Defined in

models/fields.tsx:103


error

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

models/fields.tsx:47


includeDescription

includeDescription: boolean

Should this field include a description

Defined in

models/fields.tsx:62


initialValue

initialValue: undefined | T

Initial value of this field

Defined in

models/fields.tsx:23


isSubmitting

isSubmitting: boolean

Is the form currently submitting

Defined in

models/fields.tsx:33


name

name: string

Name of the property

Defined in

models/fields.tsx:13


partOfArray

partOfArray: boolean

Is this field part of an array

Defined in

models/fields.tsx:78


property

property: Property<T, any>

Property related to this field

Defined in

models/fields.tsx:57


setValue

setValue: (value: null | T, shouldValidate?: boolean) => void

Set value of field directly

Type declaration

▸ (value, shouldValidate?): void

Parameters
Name Type
value null | T
shouldValidate? boolean
Returns

void

Defined in

models/fields.tsx:28


showError

showError: boolean

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

models/fields.tsx:40


tableMode

tableMode: boolean

Is this field being rendered in the table

Defined in

models/fields.tsx:83


touched

touched: boolean

Has this field been touched

Defined in

models/fields.tsx:52


underlyingValueHasChanged

underlyingValueHasChanged: boolean

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

Defined in

models/fields.tsx:73


value

value: T

Current value of this field

Defined in

models/fields.tsx:18