CnCardGrid
Responsive CSS grid layout for CnObjectCard instances. Auto-fills with minmax(320px, 1fr).
Wraps: NcLoadingIcon, NcEmptyContent, CnObjectCard
Try it

Props
| Prop | Type | Default | Description |
|---|---|---|---|
objects | Array | [] | Object data array |
schema | Object | null | Passed to each CnObjectCard (required only when using the default card template; not needed when providing a custom #card slot) |
loading | Boolean | false | Loading state |
pillLooks | Object | {} | The referenced records' colour and icon names, by field and id ({ [field]: { [id]: { color, icon } } }), passed to each CnObjectCard for the record layout's pills that declare resolve. |
selectable | Boolean | false | Enable card selection |
cardFieldColumns | Object | null | The page's columns by key, passed to each CnObjectCard: a fact or a layout part whose field names a column reads through that column's label, formatter and widget, as the table does |
clickToView | Boolean | false | Body click on a selectable card emits click (navigation); selection happens via the checkbox only (CnIndexPage wires this from its rowClickToView) |
selectedIds | Array | [] | Currently selected IDs |
rowKey | String | 'id' | Unique identifier field |
emptyText | String | 'No items found' | |
accentOf | Function | null | (object) => { variant, icon?, label? } | null, each default card's accent (see CnObjectCard) |
Events
| Event | Payload | Description |
|---|---|---|
click | (object, event) | Card clicked. The second argument is the native click event, for opening the card in a new tab on a ctrl/cmd/shift click. A middle click emits aux-click instead. |
aux-click | (object, event) | Card middle-clicked, under the same conditions as click. The second argument is the native auxclick event, for opening the card in a new tab. |
select | ids[] | Selection changed |
Slots
| Slot | Scope | Description |
|---|---|---|
#card | \{ object, selected, schema \} | Custom card template |
#card-actions | \{ object \} | Card action buttons |
#card-badges | \{ object \} | Card badges |
#empty | — | Custom empty state |
Usage
<CnCardGrid
:objects="contacts"
:schema="schema"
:selectable="true"
:selected-ids="selected"
@click="onCardClick"
@select="onSelect" />
Reference (auto-generated)
The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnCardGrid.vue and update automatically whenever the component changes.
OpenRegister reliance
heavy: this component cannot work without OpenRegister. 0 direct references, 16 files reached through imports.
Through: CnActionDialog, CnAssignDialog, CnBulkJobProgress, CnCellRenderer, CnFkResolveCell, CnIndexPage.
See the reliance overview for the filterable list.
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
objects | array | [] | Array of objects to display as cards | |
schema | object | null | Schema definition (passed through to CnObjectCard) | |
loading | boolean | false | Whether data is loading | |
selectable | boolean | false | Whether cards can be selected | |
clickToView | boolean | false | When true, a body click on a selectable card emits click (navigation) and selection happens via the checkbox only — the card-grid counterpart of CnIndexPage's rowClickToView. | |
selectedIds | array | [] | Array of currently selected object IDs | |
rowKey | string | 'id' | Property name used as unique identifier | |
cardFields | Array<string> | null | The property keys each card's facts list shows (manifest key config.cardFields), passed through to CnObjectCard. | |
cardLayout | object | null | Board look: the record layout each card draws (manifest key config.cardLayout), passed through to CnObjectCard layout. | |
pillLooks | object | \{\} | The referenced records' colour and icon names, by field and id ({ [field]: { [id]: { color, icon } } }), passed through to CnObjectCard for the record layout's pills that declare resolve. | |
cardFieldColumns | object | null | The page's columns by key, passed through to CnObjectCard. | |
statusOf | func | null | Board look: (object) => status for each card's status pill. See CnObjectCard status. | |
leadingOf | func | null | Board look: (object) => { initials | icon } for each card's leading element. See CnObjectCard leading. | |
footerActionOf | func | null | Board look: (object) => { label, meta? } for each card's footer action. See CnObjectCard footerAction. | |
accentOf | func | null | (object) => { variant, icon?, label? } for each card's status accent. See CnObjectCard accent. | |
emptyText | string | () => t('nextcloud-vue', 'No items found') | Text shown when there are no objects |
Events
| Name | Payload | Description |
|---|---|---|
click | undefined | |
select | — | |
aux-click | undefined | Emitted when a navigating card is middle-clicked, for opening it in a new tab (see openRowTarget). Payload: (object, event) — the card's object and the native auxclick event. |
Slots
| Name | Bindings | Description |
|---|---|---|
empty | — | |
card | object, selected, schema | |
card-actions | object | |
card-badges | object |
Board look
Under the board look the grid is repeat(auto-fill, minmax(var(--cn-card-grid-min, 260px), 1fr)) with a var(--cn-card-grid-gap, 16px) gap, theme hooks for both; without it the 320px track stands. cardFields, cardLayout (the record layout, CnObjectCard layout), statusOf, leadingOf and footerActionOf reach each default CnObjectCard.