Ga naar hoofdinhoud

CnCellRenderer

Type-aware cell renderer for schema-driven tables. Automatically formats values based on the schema property type.

Wraps: CnStatusBadge, CheckBold icon

Try it

Loading CnCellRenderer playground…

CnCellRenderer showing various cell types in a data table

Props

PropTypeDefaultDescription
valueanynullCell value
propertyObject\{\}Schema property definition
truncateNumber100Max string length before truncation

Type Rendering

Property TypeRendering
BooleanCheckBold icon (green/hidden)
EnumCnStatusBadge pill
ArrayComma-joined values or item count
Date/datetimeFormatted date string
UUIDMonospace styling
NumberTabular-nums CSS
String (long)Truncated with tooltip showing full value

Usage

CnCellRenderer is used internally by CnDataTable. You typically don't use it directly unless building a custom table:

<CnCellRenderer
:value="row.status"
:property="schema.properties.status" />

Reference (auto-generated)

The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnCellRenderer.vue and update automatically whenever the component changes.

Props

| Name | Type | Required | Default | Description | | ---------- | -------- | -------- | ------- | ------------------------------------------------------------------ | ------- | --- | ------ | ------------------ | | value | string | number | boolean | array | object | | null | The raw cell value | | property | object | | \{\} | Schema property definition: { type, format, enum, items, title } | | truncate | number | | 100 | Maximum string length before truncation |