Skip to main content

CnObjectRow

The list-mode counterpart to CnObjectCard: a compact single-line row with a leading icon (or image), a name with an optional subtitle, an optional status badge, and a trailing actions area.

Which object fields map to each part is resolved from the config prop first, then from schema.configuration (so a schema that already declares objectNameField / objectDescriptionField / objectImageField works with no extra config).

<CnObjectRow
:object="secret"
:schema="secretSchema"
:config="{ subtitleField: 'url', iconName: 'Key' }">
<template #actions="{ object }">
<NcButton @click="copy(object)">Copy</NcButton>
</template>
</CnObjectRow>

Config

The config object accepts (all optional): titleField, subtitleField, imageField, iconField, iconName, badgeField, badgeVariantField, badgeVariant, badgeColorMap.

Props

PropTypeDefaultDescription
objectObject(required)The object data.
schemaObjectnullSchema whose configuration block supplies field defaults.
configObject{}Explicit field mapping (overrides schema configuration).
selectedBooleanfalseWhether the row is selected.
selectableBooleanfalseWhether to show the selection checkbox.

Slots

  • #icon — replace the leading icon/image.
  • #badges — replace the badge area (overrides the config-driven badge).
  • #actions — trailing actions (copy button, menu, …).

Props

NameTypeRequiredDefaultDescription
objectobjectThe object data
schemaobjectnullSchema definition; schema.configuration supplies field defaults
config{ titleField?: string, subtitleField?: string, imageField?: string, iconField?: string, iconName?: string, badgeField?: string, badgeVariantField?: string, badgeVariant?: string, badgeColorMap?: object }\{\}Explicit field mapping. Every key is optional and overrides the schema-configuration default.
selectedbooleanfalseWhether this row is selected
selectablebooleanfalseWhether to show the selection checkbox

Events

NamePayloadDescription
selectEmitted when a selectable row toggles selection (body or checkbox click).
clickEmitted when a non-selectable row is clicked (navigation).

Slots

NameBindingsDescription
iconobjecticon Replace the leading icon/image.
badgesobjectbadges Replace the badge area (overrides the config-driven badge).
actionsobjectactions Trailing actions (copy button, menu, …).