Skip to content

ReferenceProperty

@firecms/core


@firecms/core / ReferenceProperty

Defined in: types/properties.ts:639

optional columnWidth: 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

BaseProperty.columnWidth


optional customProps: any

Defined in: types/properties.ts:148

Additional props that are passed to the components defined in field or in preview.

BaseProperty.customProps


dataType: "reference"

Defined in: types/properties.ts:641

Datatype of the property

BaseProperty.dataType


optional defaultValue: EntityReference | null

Defined in: types/properties.ts:153

This value will be set by default for new entities.

BaseProperty.defaultValue


optional description: string

Defined in: types/properties.ts:82

Property description, always displayed under the field

BaseProperty.description


optional disabled: 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)

BaseProperty.disabled


optional editable: 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.

BaseProperty.editable


optional Field: ComponentType<FieldProps<EntityReference, 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.

BaseProperty.Field


optional forceFilter: Partial<Record<string, [WhereFilterOp, any]>>

Defined in: types/properties.ts:659

Allow selection of entities that pass the given filter only. e.g. forceFilter: { age: [">=", 18] }


optional hideFromCollection: boolean

Defined in: types/properties.ts:106

Do not show this property in the collection view

BaseProperty.hideFromCollection


optional includeEntityLink: boolean

Defined in: types/properties.ts:676

Should the reference include a link to the entity (open the entity details). Defaults to true


optional includeId: boolean

Defined in: types/properties.ts:671

Should the reference include the ID of the entity. Defaults to true


optional longDescription: string

Defined in: types/properties.ts:95

Longer description of a field, displayed under a popover

BaseProperty.longDescription


optional name: string

Defined in: types/properties.ts:77

Property name (e.g. Product)

BaseProperty.name


optional path: string

Defined in: types/properties.ts:653

Absolute collection path of the collection this reference points to. The collection of the entity is inferred based on the root navigation, so the filters and search delegate existing there are applied to this view as well. You can leave this prop undefined if the path is not yet know, e.g. you are using a property builder and the path depends on a different property. Note that you can also use a collection id.


optional Preview: ComponentType<PropertyPreviewProps<EntityReference, 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.

BaseProperty.Preview


optional previewProperties: string[]

Defined in: types/properties.ts:666

Properties that need to be rendered when displaying a preview of this reference. If not specified the first 3 are used. Only the first 3 specified values are considered.


optional propertyConfig: 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.

BaseProperty.propertyConfig


optional readOnly: boolean

Defined in: types/properties.ts:112

Is this a read only property. When set to true, it gets rendered as a preview.

BaseProperty.readOnly


optional validation: PropertyValidationSchema

Defined in: types/properties.ts:126

Rules for validating this property

BaseProperty.validation


optional widthPercentage: 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.

BaseProperty.widthPercentage