Skip to main content
Version: 2.0.0

Interface: EntityCollection<M, AdditionalKey, UserType>

This interface represents a view that includes a collection of entities. It can be in the root level of the configuration, defining the main menu navigation. You can also find it as a subcollection of a different one.

Type parameters​

NameType
Mextends Record<string, any> = any
AdditionalKeyextends string = string
UserTypeextends User = User

Properties​

Actions​

• Optional Actions: ComponentType<CollectionActionsProps<any, User, EntityCollection<any, string, User>>> | ComponentType<CollectionActionsProps<any, User, EntityCollection<any, string, User>>>[]

Builder for rendering additional components such as buttons in the collection toolbar

Defined in​

packages/firecms/src/types/collections.ts:141


additionalColumns​

• Optional additionalColumns: AdditionalFieldDelegate<M, AdditionalKey, UserType>[]

DEPRECATED: Use additionalFields instead

This prop will be removed in the final version

You can add additional fields to the collection view by implementing an additional field delegate.

Defined in​

packages/firecms/src/types/collections.ts:201


additionalFields​

• Optional additionalFields: AdditionalFieldDelegate<M, AdditionalKey, UserType>[]

You can add additional fields to the collection view by implementing an additional field delegate.

Defined in​

packages/firecms/src/types/collections.ts:191


alias​

• Optional alias: string

You can set an alias that will be used internally instead of the path. The alias value will be used to determine the URL of the collection, while path will still be used in the datasource. Note that you can use this value in reference properties too.

Defined in​

packages/firecms/src/types/collections.ts:58


callbacks​

• Optional callbacks: EntityCallbacks<M, User>

This interface defines all the callbacks that can be used when an entity is being created, updated or deleted. Useful for adding your own logic or blocking the execution of the operation.

Defined in​

packages/firecms/src/types/collections.ts:135


collectionGroup​

• Optional collectionGroup: boolean

If this collection is a top level navigation entry, you can set this property to true to indicate that this collection is a collection group.

Defined in​

packages/firecms/src/types/collections.ts:50


customId​

• Optional customId: boolean | EnumValues | "optional"

If this property is not set, the property will be created by the datasource. You can set the value to true to allow the users to choose the ID. You can also pass a set of values (as an EnumValues object) to allow them to pick from only those.

Defined in​

packages/firecms/src/types/collections.ts:157


defaultSelectedView​

• Optional defaultSelectedView: string | DefaultSelectedViewBuilder

If you want to open custom views or subcollections by default when opening the edit view of an entity, you can specify the path to the view here. The path is relative to the current collection. For example if you have a collection that has a custom view as well as a subcollection that refers to another entity, you can either specify the path to the custom view or the path to the subcollection.

Defined in​

packages/firecms/src/types/collections.ts:231


defaultSize​

• Optional defaultSize: CollectionSize

Default size of the rendered collection

Defined in​

packages/firecms/src/types/collections.ts:206


description​

• Optional description: string

Optional description of this view. You can use Markdown.

Defined in​

packages/firecms/src/types/collections.ts:37


forceFilter​

• Optional forceFilter: Partial<Record<Extract<keyof M, string>, [WhereFilterOp, any]>>

Force a filter in this view. If applied, the rest of the filters will be disabled. Filters applied with this prop cannot be changed. e.g. forceFilter: { age: [">=", 18] }

Defined in​

packages/firecms/src/types/collections.ts:164


formAutoSave​

• Optional formAutoSave: boolean

If set to true, the form will be auto-saved when the user changes the value of a field. Defaults to false. You can't use this prop if you are using a customId

Defined in​

packages/firecms/src/types/collections.ts:249


group​

• Optional group: string

Optional field used to group top level navigation entries under a~ navigation view. If you set this value in a subcollection it has no effect.

Defined in​

packages/firecms/src/types/collections.ts:73


hideFromNavigation​

• Optional hideFromNavigation: boolean

Should this collection be hidden from the main navigation panel, if it is at the root level, or in the entity side panel if it's a subcollection. It will still be accessible if you reach the specified path. You can also use this collection as a reference target.

Defined in​

packages/firecms/src/types/collections.ts:222


hideIdFromCollection​

• Optional hideIdFromCollection: boolean

Should the ID of this collection be hidden from the grid view.

Defined in​

packages/firecms/src/types/collections.ts:241


hideIdFromForm​

• Optional hideIdFromForm: boolean

Should the ID of this collection be hidden from the form view.

Defined in​

packages/firecms/src/types/collections.ts:236


icon​

• Optional icon: string

Icon key to use in this collection. You can use any of the icons in the MUI specs: https://mui.com/material-ui/material-icons/ e.g. 'AccountTree' or 'Person'

Defined in​

packages/firecms/src/types/collections.ts:66


initialFilter​

• Optional initialFilter: Partial<Record<Extract<keyof M, string>, [WhereFilterOp, any]>>

Initial filters applied to the collection this collection is related to. Defaults to none. Filters applied with this prop can be changed. e.g. initialFilter: { age: [">=", 18] }

Defined in​

packages/firecms/src/types/collections.ts:171


initialSort​

• Optional initialSort: [Extract<keyof M, string>, "asc" | "desc"]

Default sort applied to this collection. When setting this prop, entities will have a default order applied in the collection. e.g. initialSort: ["order", "asc"]

Defined in​

packages/firecms/src/types/collections.ts:179


inlineEditing​

• Optional inlineEditing: boolean

Can the elements in this collection be edited inline in the collection view. If this flag is set to false but permissions.edit is true, entities can still be edited in the side panel

Defined in​

packages/firecms/src/types/collections.ts:213


name​

• name: string

Name of the collection, typically plural. E.g. Products, Blog

Defined in​

packages/firecms/src/types/collections.ts:26


pagination​

• Optional pagination: number | boolean

If enabled, content is loaded in batches. If false all entities in the collection are loaded. You can specify a number to specify the pagination size (50 by default) Defaults to true

Defined in​

packages/firecms/src/types/collections.ts:104


path​

• path: string

Relative path of this view to its parent. If this view is in the root the path is equal to the absolute one. This path also determines the URL in FireCMS, unless an alias is specified

Defined in​

packages/firecms/src/types/collections.ts:44


permissions​

• Optional permissions: Permissions | PermissionsBuilder<EntityCollection<M, string, User>, UserType, M>

Permissions the logged-in user can perform on this collection. If not specified everything defaults to true.

Defined in​

packages/firecms/src/types/collections.ts:116


properties​

• properties: PropertiesOrBuilders<M>

Set of properties that compose an entity

Defined in​

packages/firecms/src/types/collections.ts:78


propertiesOrder​

• Optional propertiesOrder: (Extract<keyof M, string> | Extract<AdditionalKey, 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. Additional columns are added at the end of the list, if the order is not specified. You can use this prop to hide some properties from the table view. Note that if you set this prop, other ways to hide fields, like hidden in the property definition, will not work.

- For properties use the property key.
- For additional columns use the column id.
- If you have subcollections, you get a column for each subcollection,
with the path (or alias) as the subcollection, prefixed with
`subcollection:`. e.g. `subcollection:orders`.
- If you are using a collection group, you will also have an
additional `collectionGroupParent` column.

Defined in​

packages/firecms/src/types/collections.ts:96


selectionController​

• Optional selectionController: SelectionController<M>

Pass your own selection controller if you want to control selected entities externally.

See

useSelectionController

Defined in​

packages/firecms/src/types/collections.ts:148


selectionEnabled​

• Optional selectionEnabled: boolean

Are the entities in this collection selectable. Defaults to true

Defined in​

packages/firecms/src/types/collections.ts:121


singularName​

• Optional singularName: string

Singular name of an entry in this collection E.g. Product, Blog entry

Defined in​

packages/firecms/src/types/collections.ts:32


subcollections​

• Optional subcollections: EntityCollection<any, any, User>[]

You can add subcollections to your entity in the same way you define the root collections. The collections added here will be displayed when opening the side dialog of an entity.

Defined in​

packages/firecms/src/types/collections.ts:128


textSearchEnabled​

• Optional textSearchEnabled: boolean

Flag to indicate if a search bar should be displayed on top of the collection table.

Defined in​

packages/firecms/src/types/collections.ts:110


views​

• Optional views: EntityCustomView<M>[]

Array of builders for rendering additional panels in an entity view. Useful if you need to render custom views

Defined in​

packages/firecms/src/types/collections.ts:185

Enterprise or start-up?

Learn how to get the most out of your project with the help of our consulting team.
Learn more
Sign up to our newsletter to get the latest news and updates. No spam!