ArrayProperty
@firecms/core / ArrayProperty
Interface: ArrayProperty<T, ArrayT>
Section titled “Interface: ArrayProperty<T, ArrayT>”Defined in: types/properties.ts:439
Extends
Section titled “Extends”BaseProperty<T>
Type Parameters
Section titled “Type Parameters”T extends ArrayT[] = any[]
ArrayT
Section titled “ArrayT”ArrayT extends CMSType = any
Properties
Section titled “Properties”canAddElements?
Section titled “canAddElements?”
optionalcanAddElements:boolean
Defined in: types/properties.ts:519
Can the elements in this array be added. Defaults to true
This prop has no effect if disabled is set to true.
columnWidth?
Section titled “columnWidth?”
optionalcolumnWidth:number
Defined in: types/properties.ts:101
Width in pixels of this column in the collection view. If not set the width is inferred based on the other configurations
Inherited from
Section titled “Inherited from”customProps?
Section titled “customProps?”
optionalcustomProps:any
Defined in: types/properties.ts:148
Additional props that are passed to the components defined in field
or in preview.
Inherited from
Section titled “Inherited from”dataType
Section titled “dataType”dataType:
"array"
Defined in: types/properties.ts:441
Datatype of the property
Overrides
Section titled “Overrides”defaultValue?
Section titled “defaultValue?”
optionaldefaultValue:T|null
Defined in: types/properties.ts:153
This value will be set by default for new entities.
Inherited from
Section titled “Inherited from”description?
Section titled “description?”
optionaldescription:string
Defined in: types/properties.ts:82
Property description, always displayed under the field
Inherited from
Section titled “Inherited from”disabled?
Section titled “disabled?”
optionaldisabled:boolean|PropertyDisabledConfig
Defined in: types/properties.ts:121
Is this field disabled. When set to true, it gets rendered as a disabled field. You can also specify a configuration for defining the behaviour of disabled properties (including custom messages, clear value on disabled or hide the field completely)
Inherited from
Section titled “Inherited from”editable?
Section titled “editable?”
optionaleditable:boolean
Defined in: types/properties.ts:159
Should this property be editable. If set to true, the user will be able to modify the property and save the new config. The saved config will then become the source of truth.
Inherited from
Section titled “Inherited from”expanded?
Section titled “expanded?”
optionalexpanded:boolean
Defined in: types/properties.ts:501
Should the field be initially expanded. Defaults to true
Field?
Section titled “Field?”
optionalField:ComponentType<FieldProps<T,any,any>>
Defined in: types/properties.ts:135
If you need to render a custom field, you can create a component that
takes FieldProps as props. You receive the value, a function to
update the value and additional utility props such as if there is an error.
You can customize it by passing custom props that are received
in the component.
Inherited from
Section titled “Inherited from”hideFromCollection?
Section titled “hideFromCollection?”
optionalhideFromCollection:boolean
Defined in: types/properties.ts:106
Do not show this property in the collection view
Inherited from
Section titled “Inherited from”BaseProperty.hideFromCollection
longDescription?
Section titled “longDescription?”
optionallongDescription:string
Defined in: types/properties.ts:95
Longer description of a field, displayed under a popover
Inherited from
Section titled “Inherited from”minimalistView?
Section titled “minimalistView?”
optionalminimalistView:boolean
Defined in: types/properties.ts:507
Display the child properties directly, without being wrapped in an extendable panel.
optionalname:string
Defined in: types/properties.ts:77
Property name (e.g. Product)
Inherited from
Section titled “Inherited from”
optionalof:PropertyOrBuilder<ArrayT,any> |Property<ArrayT>[]
Defined in: types/properties.ts:449
The property of this array.
You can specify any property (except another Array property)
You can leave this field empty only if you are providing a custom field,
or using the oneOf prop, otherwise an error will be thrown.
oneOf?
Section titled “oneOf?”
optionaloneOf:object
Defined in: types/properties.ts:466
Use this field if you would like to have an array of typed objects. It is useful if you need to have values of different types in the same array. Each entry of the array is an object with the shape:
{ type: "YOUR_TYPE", value: "YOUR_VALUE"}Note that you can use any property so value can take any value (strings,
numbers, array, objects…)
You can customise the type and value fields to suit your needs.
An example use case for this feature may be a blog entry, where you have images and text blocks using markdown.
properties
Section titled “properties”properties:
Properties
Record of properties, where the key is the type and the value
is the corresponding property
propertiesOrder?
Section titled “propertiesOrder?”
optionalpropertiesOrder:string[]
Order in which the properties are displayed.
If you are specifying your collection as code, the order is the same as the
one you define in properties, and you don’t need to specify this prop.
typeField?
Section titled “typeField?”
optionaltypeField:string
Name of the field to use as the discriminator for type
Defaults to type
valueField?
Section titled “valueField?”
optionalvalueField:string
Name of the field to use as the value
Defaults to value
Preview?
Section titled “Preview?”
optionalPreview:ComponentType<PropertyPreviewProps<T,any>>
Defined in: types/properties.ts:142
Configure how a property is displayed as a preview, e.g. in the collection view. You can customize it by passing custom props that are received in the component.
Inherited from
Section titled “Inherited from”propertyConfig?
Section titled “propertyConfig?”
optionalpropertyConfig:string
Defined in: types/properties.ts:90
You can use this prop to reuse a property that has been defined
in the top level of the CMS in the prop fields.
All the configuration will be taken from the inherited config, and
overwritten by the current property config.
Inherited from
Section titled “Inherited from”readOnly?
Section titled “readOnly?”
optionalreadOnly:boolean
Defined in: types/properties.ts:112
Is this a read only property. When set to true, it gets rendered as a preview.
Inherited from
Section titled “Inherited from”sortable?
Section titled “sortable?”
optionalsortable:boolean
Defined in: types/properties.ts:513
Can the elements in this array be reordered. Defaults to true.
This prop has no effect if disabled is set to true.
validation?
Section titled “validation?”
optionalvalidation:ArrayPropertyValidationSchema
Defined in: types/properties.ts:496
Rules for validating this property
Overrides
Section titled “Overrides”widthPercentage?
Section titled “widthPercentage?”
optionalwidthPercentage:number
Defined in: types/properties.ts:165
A number between 0 and 100 that indicates the width of the field in the form view. It defaults to 100, but you can set it to 50 to have two fields in the same row.