useFieldExtension
useFieldExtension()
Hook function for field elements.
Properties
name
typestring
Name of the field in the form.locale
typestring
Current locale on localized field.entryId
typestring
|null
Id of the current entry, null on a new entry.isTableCell
typeboolean
Whether or not the field displays in a table view.value
typeany
Value field.onBlur
typemethod
Is triggered when an HTML element loses focus.onChange
typemethod
Is triggered when you change the value.onFocus
typemethod
Is triggered when an element gets focus.meta
active
typeboolean
Whether or not the field currently has focus.error
typeany
The current validation error for the field.touched
typeboolean
Whether or not this field has ever gained and lost focus.
It can be useful to indicate when to display error messages.
form
typeObject
|Form
Contains methods to interact with the content formfield
id
typestring
Id of the current field.apiId
typestring
apiId of the current field.description
typestring
|null
Description of the current field.displayName
typestring
|null
Display name of the current field.isList
typeboolean
Whether or not not the current field is a list.isLocalized
typeboolean
Whether or not the current field is localized.isRequired
typeboolean
Whether or not the current field is required.isUnique
typeboolean
Whether or not the current field is unique.isUnique
typeboolean
Whether or not the current field is unique.isPreview
typeboolean
Whether or not the current field is a preview. True when in version or stage comparison viewtype
typeFieldExtensionType
Key ofFieldExtensionType
.
model
typeModel
Details about the current model.extension
config
typeobject
Global configuration of the field.fieldConfig
typeobject
Configurations that display at the field level.tableConfig
typeobject
Configurations that display at the table level.
isExpanded
typeboolean
Whether or not the field is currently in fullscreen mode.expand
typeboolean
Sets fullscreen mode.
Returns
<FieldExtensionProps | interface>