EntityList
The EntityList is used to represent lists of entities (entries and assets).
How to use EntityList
This component should be used in combination with the EntityList.Item component. Its main purpose is to be used to entries or assets when in a list context, for example, a multiple entry reference field. It differs from existing EntryCard/AssetCard components as its intended use is for lists of entities, not individual ones.
Code examples
With actions menu
With drag handle
Props
EntityList
- Name
children
ReactNode - Name
className
DescriptionCSS class to be appended to the root element
string - Name
testId
DescriptionA [data-test-id] attribute used for testing purposes
string
EntityList.Item
- Name
title(required)
DescriptionThe title of the entity
string - Name
actions
DescriptionMenu elements rendered as actions in Menu
ReactNodeArray - Name
cardDragHandleComponent
DescriptionProp to pass a custom CardDragHandle component to for use in drag and drop contexts
stringnumberfalsetrue{}ReactNodeArrayReactElement<any, string | JSXElementConstructor<any>>ReactPortal - Name
cardDragHandleProps
DescriptionProps to pass down to the default CardDragHandle component (does not work with cardDragHandleComponent prop)
Partial<DragHandleProps> - Name
className
DescriptionCSS class to be appended to the root element
string - Name
contentType
DescriptionThe content type of the entity
string - Name
description
DescriptionThe description of the entity
string - Name
entityType
DescriptionAn entity can either be an Entry, an Asset or a Release. This prop will apply styling based on if the entity is an asset, a release or an entry Note: 'entry' and 'asset' are @deprecated but supported in v1.x for backwards compatibility
Default"Entry""Asset""entry""asset""Release"entry - Name
href
DescriptionThe href for the component. Will render the card as an `a` element for native browser link handling
string - Name
isActionsDisabled
DescriptionA boolean used to disable the CardActions
Defaultfalsetruefalse - Name
isDragActive
DescriptionApplies styling for when the component is actively being dragged by the user
falsetrue - Name
isLoading
DescriptionLoading state for the component - when true will display loading feedback to the user
falsetrue - Name
onClick
DescriptionThe action to be performed on click of the EntryCard
MouseEventHandler<Element> - Name
status
DescriptionThe publish status of the entry
"archived""changed""draft""published" - Name
testId
DescriptionA [data-test-id] attribute used for testing purposes
Defaultstringcf-ui-entity-list-item - Name
thumbnailAltText
DescriptionThe alt text for the thumbnail
string - Name
thumbnailUrl
DescriptionThe URL of the entity's preview thumbnail. Use 46px x 46px images for best results
string - Name
withDragHandle
DescriptionRenders a drag handle for the component for use in drag and drop contexts
falsetrue - Name
withThumbnail
DescriptionA boolean used to render the Thumbnail or not
Defaultfalsetruetrue