Card View

When you want to display entities as cards within a collection, use the Card Collection View Kind. This will render a card-style grid layout. Each card renders a default layout with the entity's name and icon. You can further customize the card layout by registering a custom card collection item as needed.

The default Collection Item Model used in a Card Collection View is based on the following interface:

export interface UmbCollectionItemModel {
  unique: string;
  entityType: string;
  name?: string;
  icon?: string;
}

Register the Card Collection View in the extension registry with the kind set to "card":

Manifest

umbraco-package.json
{
  "type": "collectionView",
  "kind": "card",
  "alias": "My.CollectionView.Card",
  "name": "My Card Collection View",
  "conditions": [
    {
      "alias": "Umb.Condition.CollectionAlias",
      "match": "My.Collection" // Collection alias to display this collection view for
    }
  ]
}

Custom Card Collection Item

If you want to customize how each item is rendered, you can create and register a custom Card Collection Item.

Manifest

Implementation

Implement your custom Card Collection Item as a Lit element that extends UmbLitElement. This defines how an individual card is rendered in the collection.

Get more information about Card elements and base element starting points at the UI Library documentationarrow-up-right

Last updated

Was this helpful?