Ga naar hoofdinhoud

CnWidgetCardGrid

CnWidgetCardGrid is the built-in v2 widget that renders a grid of CnObjectCard items. It replaces the v1.3.0 cardComponent field pattern with a manifest-driven entry.

Import​

import { CnWidgetCardGrid } from '@conduction/nextcloud-vue'

Manifest usage​

Referenced via widgetKey: "card-grid":

{
"id": "sources-cards",
"slot": "body",
"widgetKey": "card-grid",
"gridWidth": 12,
"props": {
"objects": [
{ "id": "1", "name": "Stripe API", "status": "ok" },
{ "id": "2", "name": "HubSpot CRM", "status": "degraded" }
]
}
}

Each item in objects is rendered as a CnObjectCard, laid out in a responsive flex grid inside the widget's cell.

Without objects, the cards can come from an app endpoint:

{ "props": { "endpointSource": { "url": "/apps/shillinq/api/v1/cash-position", "responsePath": "accounts" } } }

Props​

PropTypeDescription
objectsArrayObject records to render as cards.
endpoint-sourceObjectRead the objects from an app endpoint: { url, method?, params?, responsePath? }, the shape the object table takes. The payload at responsePath is the array of objects. Ignored while objects holds any (default null).
titleStringWidget title shown in the chrome header (default 'Items').
documentation-urlStringDocumentation link for the overflow Actions menu (default '').
widget-idStringStable id forwarded to the widget chrome (default '').
chromelessBooleanDraw no frame, title or Actions menu of its own, because the surface around it already draws the card. CnDashboardPage sets it for a card-grid in a cell (default false).

(Forwarded to CnObjectCard per item — see its docs for the per-card surface.)

Events​

Forwarded to each CnObjectCard instance — typically @click, @edit, etc. The handler receives the card's object record.

Spec​

  • REQ-MVR-010 (manifest-v2-renderer) — built-in widget: card-grid