Skip to main content

CnCardGrid

Responsive CSS grid layout for CnObjectCard instances. Auto-fills with minmax(320px, 1fr).

Wraps: NcLoadingIcon, NcEmptyContent, CnObjectCard

Try it

Loading CnCardGrid playground…

CnCardGrid showing a grid of object cards

Props

PropTypeDefaultDescription
objectsArray[]Object data array
schemaObjectnullPassed to each CnObjectCard (required only when using the default card template; not needed when providing a custom #card slot)
loadingBooleanfalseLoading state
selectableBooleanfalseEnable card selection
selectedIdsArray[]Currently selected IDs
rowKeyString'id'Unique identifier field
emptyTextString'No items found'

Events

EventPayloadDescription
clickobjectCard clicked
selectids[]Selection changed

Slots

SlotScopeDescription
#card\{ object, selected, schema \}Custom card template
#card-actions\{ object \}Card action buttons
#card-badges\{ object \}Card badges
#emptyCustom 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.

Props

NameTypeRequiredDefaultDescription
objectsarray[]Array of objects to display as cards
schemaobjectnullSchema definition (passed through to CnObjectCard)
loadingbooleanfalseWhether data is loading
selectablebooleanfalseWhether cards can be selected
selectedIdsarray[]Array of currently selected object IDs
rowKeystring'id'Property name used as unique identifier
emptyTextstring() =&gt; t('nextcloud-vue', 'No items found')Text shown when there are no objects

Events

NamePayloadDescription
click
select

Slots

NameBindingsDescription
empty
cardobject, selected, schema
card-actionsobject
card-badgesobject