DOCS
v0.4

AI Components / Data Card

Data Card

Compact inline key-value data display. Embed in chat messages, tool results, and insight cards. Shows any structured data with type-specific formatting.

ai-displayv0.4.0

Playground

Examples

Invoice
<ai-data-card title="Invoice #1042" subtitle="Acme Corp" icon="DOC" headerStatus="warning" headerStatusLabel="Pending" style="max-width: 380px;"></ai-data-card>
AI Model Info
<ai-data-card title="Claude 3.5 Sonnet" icon="AI" headerStatus="success" headerStatusLabel="Active" style="max-width: 380px;"></ai-data-card>
Compact
<ai-data-card title="Order #8821" icon="PKG" compact style="max-width: 300px;"></ai-data-card>
Loading
<ai-data-card loading style="max-width: 380px;"></ai-data-card>

Import

import { AiDataCard } from '@cognivo/components';
// Or tree-shake: import '@cognivo/components/ai-data-card';

Per-component imports ship only that component (~8 kB gzip).

API Reference

PropTypeDefaultDescription
titlestringCard title
subtitlestringSubtitle text
iconstringHeader icon text
headerStatus"success"|"warning"|"error"|"info"|"neutral"Header badge color
headerStatusLabelstringHeader badge text
fieldsDataField[]Key-value rows with optional type formatting
actionsCardAction[]Footer action buttons
compactbooleanfalseCompact display mode
loadingbooleanfalseShow loading skeleton
highlightedbooleanfalseAccent border

Events

EventDetailDescription
ai-data-card-action{actionId, actionLabel}Action button clicked
ai-data-card-row-click{label, value, type}Row clicked