Skip to main content

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

Loading CnObjectCard playground…

CnObjectCard showing client data in card layout

Props

PropTypeDefaultDescription
objectObject(required)Object data
schemaObject(required)Schema with properties and configuration
selectedBooleanfalseSelection state
selectableBooleanfalseShow selection checkbox
maxMetadataNumber4Max metadata fields shown

Schema Configuration Keys

The schema's configuration object controls card layout:

KeyDescription
objectNameFieldField used as card title
objectDescriptionFieldField used as description text
objectImageFieldField containing image URL
objectSummaryFieldField used as summary

Events

EventPayloadDescription
clickobjectCard clicked
selectobjectSelection checkbox toggled

Slots

SlotScopeDescription
#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.

Props

NameTypeRequiredDefaultDescription
objectobjectThe object data
schemaobjectSchema definition with properties and configuration
selectedbooleanfalseWhether this card is selected
selectablebooleanfalseWhether to show selection checkbox
maxMetadatanumber4Maximum number of metadata fields to show

Events

NamePayloadDescription
click
select

Slots

NameBindingsDescription
badgesobject
metadataobject, fields
actionsobject