CnObjectCard
Schema-driven card for displaying an object's key information. Uses schema configuration to determine which fields to show as title, description, image, and metadata.
Wraps: NcCheckboxRadioSwitch, CnCellRenderer
Try it

Props
| Prop | Type | Default | Description |
|---|---|---|---|
object | Object | (required) | Object data |
schema | Object | (required) | Schema with properties and configuration |
selected | Boolean | false | Selection state |
pillLooks | Object | {} | The referenced records' colour and icon names, by field and id ({ [field]: { [id]: { color, icon } } }, read by CnIndexPage). A record layout pill with resolve: { colorField?, iconField? } takes its record's tone and icon from here. |
selectable | Boolean | false | Show selection checkbox |
cardFieldColumns | Object | null | The page's columns by key: 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) instead of toggling selection — the checkbox stays the only selection surface (the card counterpart of a table's rowClickToView) |
maxMetadata | Number | 4 | Max metadata fields shown |
accent | Object | null | Status accent { variant, icon?, label? }: a 4px start border in the variant color (success, warning, error, info, primary) and, with icon (a CnIcon name), a colored icon before the title. label is the icon's tooltip and accessible name. An unknown variant draws nothing. |
Schema Configuration Keys
The schema's configuration object controls card layout:
| Key | Description |
|---|---|
objectNameField | Field used as card title |
objectDescriptionField | Field used as description text |
objectImageField | Field containing the image, resolved through resolveImageUrl (an app:<app>/<file> reference or an /apps/… route becomes a real URL; an absolute URL is used as-is) |
objectSummaryField | Field used as summary |
Events
| Event | Payload | Description |
|---|---|---|
aux-click | (object, event) | Card middle-clicked (auxclick), under the same conditions as a navigating click. The second argument is the native event, for opening the card in a new tab. |
click | (object, event) | Card clicked. The second argument is the native event, for opening the card in a new tab on a ctrl/cmd/shift click; a middle click emits aux-click instead. When selectable is false this is the primary navigation event. When selectable is true a deliberate click emits select (a text-selection drag is not treated as a click); for backwards compatibility click is also emitted (with a console.warn deprecation notice) if a @click listener is present — migrate selectable consumers to @select. |
select | object | Selection toggled — emitted by the checkbox, and (when selectable) by a deliberate click anywhere on the card body. |
Slots
| Slot | Scope | Description |
|---|---|---|
#badges | \{ object \} | Badge section |
#actions | \{ object \} | Actions section |
#metadata | \{ object, fields \} | Metadata section override |
Usage
<CnObjectCard
:object="contact"
:schema="contactSchema"
:selectable="true"
@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 CnObjectCard.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 |
|---|---|---|---|---|
object | object | ✓ | — | The object data |
schema | object | ✓ | — | Schema definition with properties and configuration |
selected | boolean | false | Whether this card is selected | |
selectable | boolean | false | Whether to show selection checkbox | |
clickToView | boolean | false | When true, a body click on a SELECTABLE card emits click (navigation) instead of toggling selection — selection then happens via the checkbox only. The card counterpart of CnIndexPage's rowClickToView (a table row click already navigates in that mode). | |
status | (string|{label: string, variant?: string}) | null | Board look: the status pill at the end of the head row, as a label ("Open") or { label, variant } with a CnStatusBadge variant (success, warning, error, info, primary, default). Without it the head row ends in the row menu, when there is one. | |
leading | {initials?: string, icon?: string} | null | Board look: the leading element of the head row. { initials } draws the initials in a 36px circle; { icon } a schema icon in a 36px rounded square on a tint. | |
footerAction | {label: string, meta?: string, ariaLabel?: string} | null | Board look: the card's one footer action. { label, meta?, ariaLabel? }; meta is the 13px muted text at the start of the footer. Clicking emits footer-action. | |
accent | {variant: string, icon?: string, label?: string} | null | A status accent: a colored border at the start of the card and, with icon, a colored icon before the title. variant is one of success, warning, error, info or primary; icon is a name registered with CnIcon; label names the status for screen readers and as the icon's tooltip. | |
layout | {headPill?: object, number?: string, title?: string, meta?: Array<string>, description?: (string|{field: string, maxLength?: number}), chips?: Array<object>, note?: {field: string, formatter?: string, formatterOptions?: object, tone?: string}, footerPill?: object, footerDate?: {field: string, label?: string, overdueVariant?: string}} | null | Board look: the record layout (manifest key config.cardLayout). Every part names a field of the object (a dot path) and is left out while that field is empty: { headPill, number, title, meta, footerPill, footerDate }. A pill is { field, colorMap?, labels?, variant? }: colorMap maps a value to a CnStatusBadge variant (ignoring case), labels a value to the text shown. meta is a list of fields, joined with " · ". footerDate is { field, label?, overdueVariant? }, drawn as "Termijn 5 okt", in overdueVariant's tone (error) once the date has passed. description is a field (or { field, maxLength? }, cut at 140 characters by default) drawn under the meta line. chips is a list of { field, formatter?, formatterOptions?, colorMap?, labels?, variant? }, each a pill whose text reads through the formatter; with each a list field gives one pill per entry (each names the entry's field or is a template). A meta part may be { template }, a line filled from the object ('{stages|count} stages'). note is { field, formatter?, formatterOptions?, tone? }, a line under the meta line in the purple or teal pill ink. Without it the card keeps its head, facts and action. | |
pillLooks | object | \{\} | The referenced records' colour and icon names, by field and id ({ [field]: { [id]: { color, icon } } }, CnIndexPage reads them). A record layout pill with resolve: { colorField?, iconField? } takes its record's tone and icon from here. | |
cardFields | Array<string> | null | The property keys the facts list shows, in order (manifest key config.cardFields). Without it the card shows the first maxMetadata visible properties, as before. | |
cardFieldColumns | object | null | The page's columns by key: a fact whose key names a column renders through that column's label, formatter and widget, as the table does. | |
maxMetadata | number | 4 | Maximum number of metadata fields to show |
Events
| Name | Payload | Description |
|---|---|---|
select | — | Emitted when the card toggles selection (clicking the body of a selectable card, or its checkbox). |
footer-action | — | |
click | undefined | Emitted when a non-selectable (or clickToView) card is clicked. Payload: (object, event) — the card's object and the native click event, for opening it in a new tab on a ctrl/cmd/shift click. A middle click emits aux-click instead. Selectable cards emit select; they also emit click (deprecated) when a click listener is present, so migrate selectable consumers to @select. |
aux-click | undefined | Emitted when a non-selectable (or clickToView) 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 |
|---|---|---|
actions | object | |
badges | object | |
metadata | object, fields |
Board look
Under the board look the card is white with a 12px radius, no shadow and no hover lift. The head row holds an optional leading element ({ initials } in a 36px circle, or { icon } on a tint), the title with the description as its sub line, and at the end the status pill (a label, or { label, variant }) or, without a status, the row menu from the actions slot. cardFields (property keys, in order) fills a two-column facts list; without it the card shows its first maxMetadata properties. footerAction ({ label, meta?, ariaLabel? }) adds a footer with one action and emits footer-action. The metadata slot still replaces the facts list. The accent border and icon show in the board look too, also on hover and on a selected card.
Record layout (layout, manifest config.cardLayout)
With a layout the board card draws a record: a head pill and the number, the title, a meta line, an optional description and chips, and a footer with a pill and a date. Every part names a field (a dot path) and is left out while that field is empty.
| Part | Shape | Draws |
|---|---|---|
headPill, footerPill | { field, colorMap?, labels?, variant? } | A pill. |
number, title | field | The number at the end of the head; the title. |
meta | list of fields or { field, formatter? } | One line, joined with " · ". |
description | field, or { field, maxLength? } | A line under the meta line, cut at maxLength characters (140 by default) with an ellipsis. |
chips | list of fields or { field, formatter?, formatterOptions?, colorMap?, labels?, variant? } | A pill per entry, its text read through the formatter (a status uuid as its name). |
footerDate | { field, label?, overdueVariant? } | "Deadline 5 Oct", in the overdueVariant tone (error) once the date has passed. |