Skip to content

OrigamDataList ​

<OrigamDataList> renders a definition list (<dl>) from a structured items array. Two layouts are available, picked by the mode prop:

modeUse caseItems shape
"avatar" (default)Stacked title + multi-row text items, optionally with prepend/append icons or avatarsIDataItem
"kv"PDF-aligned key / value rows — label on the left, value on the rightIDataListKVItem

Props ​

Own props ​

PropTypeDefaultDescription
modeTDataListMode — 'avatar' | 'kv''avatar'Selects the layout. 'kv' switches to the key/value rows.
itemsIDataItem[] | Record<string, IDataItem> | IDataListKVItem[] | Record<string, IDataListKVItem>—Source list. Shape is gated by mode. Keyed objects are flattened with Object.values.

Adjacent props (IAdjacentProps) — forwarded to each OrigamDataTitle ​

PropTypeDescription
prependIconTIconIcon before the title
appendIconTIconIcon after the title
prependAvatarstringAvatar image before the title
appendAvatarstringAvatar image after the title

These four are only read in avatar mode — KV rows render no title component, so they have no effect when mode="kv".

Transversal props ​

All of these are consumed on the root <dl> through the shared composables.

GroupPropsComposable
Colorcolor, bgColoruseBothColor
DensitydensityuseDensity
ElevationelevationuseElevation
Roundedrounded, roundedTopLeft, roundedTopRight, roundedBottomLeft, roundedBottomRightuseRounded
Borderborder, borderTop, borderRight, borderBottom, borderLeft, borderBlock, borderInline, borderColor, borderStyle, borderTopColor, borderRightColor, borderBottomColor, borderLeftColoruseBorder
Paddingpadding, paddingTop, paddingRight, paddingBottom, paddingLeft, paddingBlock, paddingInlineusePadding
Marginmargin, marginTop, marginRight, marginBottom, marginLeft, marginBlock, marginInlineuseMargin
TypographyfontSize, fontWeight, lineHeight, letterSpacing — see Typography propsuseTypography (×2)
Commonsid, class, style—

Avatar mode (default — back-compatible) ​

vue
<template>
    <OrigamDataList :items="items" />
</template>

<script setup>
const items = [
    { title: { text: 'Status' }, text: [{ text: 'Active' }] },
    { title: { text: 'Created' }, text: [{ text: '2024-01-15' }] },
]
</script>

Items structure ​

ts
interface IDataItem {
    title?: IDataTitleProps   // term (<dt>)
    text?: IDataTextProps[]   // definition rows (<dd>)
}

Pass either an array or a keyed object.

Prepend / append icons ​

vue
<OrigamDataList :items="items" prepend-icon="mdi-information" />

Adjacent props (prependIcon, appendIcon, prependAvatar, appendAvatar) are forwarded to each OrigamDataTitle.

Density ​

vue
<OrigamDataList :items="items" density="compact" />

KV mode (PDF-aligned key/value rows) ​

vue
<template>
    <OrigamDataList mode="kv" :items="kv" />
</template>

<script setup lang="ts">
import type { IDataListKVItem } from '@origam/interfaces'
import { OrigamChip } from '@origam/components'

const kv: IDataListKVItem[] = [
    { key: 'Status',     value: { component: OrigamChip, props: { text: 'Active', bgColor: 'success' } } },
    { key: 'Owner',      value: 'Arnaud Martin' },
    { key: 'Created at', value: 'Apr 12, 2026' },
]
</script>

Items structure ​

ts
interface IDataListKVItem {
    key: string
    value: string | number | VNode | IDataListKVItemValueComponent
    id?: string | number
}

interface IDataListKVItemValueComponent {
    component: string | object       // tag name OR imported component
    props?: Record<string, unknown>
    children?: string | number       // optional default-slot text
}

The component renders a <dl> with one <dt> (key) and one <dd> (value) per row. Rows are stacked vertically with a 1px subtle divider between them; the layout uses CSS grid with a fixed key column and a fluid value column.

Per-row test hooks ​

Each row carries data-cy="data-list-kv-row-{kebab(key)}" so e2e tests can target specific rows without relying on text content order.

Slots ​

Avatar mode ​

SlotBindingsDescription
default{ items }Full list override
item{ item, index }Custom item renderer
item-{n}{ item, index }Override for item at index n
item.titlepropsCustom title for every item
item-{n}.titlepropsCustom title for item at index n
item.title.prepend—Prepend slot for every title
item.title.append—Append slot for every title
item.text—Custom text renderer
item-{n}.text—Custom text for item at index n
item.text.prepend—Prepend slot for every text row
item.text.append—Append slot for every text row

KV mode ​

SlotBindingsDescription
default{ items }Full list override
key{ key, item, index }Custom key (<dt>) renderer for every row
item-{n}.key{ key, item, index }Override the key cell for row n
value{ key, value, item, index }Custom value (<dd>) renderer for every row
item-{n}.value{ key, value, item, index }Override the value cell for row n

Typography props ​

Control the font appearance of both the title (__title) and text (__text) sub-elements. Custom properties cascade from the root <dl> to the child elements where the matching SCSS rules consume them.

PropType__title effect__text effectCSS variable emitted
fontSizeTFontSizefont-sizefont-size--origam-font__size---{value}
fontWeightTFontWeightfont-weight—--origam-font__weight---{value}
lineHeightTLineHeightline-heightline-height--origam-font__lineHeight---{value}
letterSpacingTLetterSpacingletter-spacingletter-spacing--origam-font__letterSpacing---{value}

fontWeight has a real visual effect only on __title (the SCSS reads --origam-data-list__title---font-weight). It still emits the __text var but the __text SCSS block has no font-weight rule, so it is effectively a no-op on the text rows.

Emits ​

OrigamDataList is display-only — it does not emit events.

Design tokens ​

Every variable below is read by OrigamDataList.vue's own scoped SCSS and declared in packages/ds/src/assets/css/tokens/light.css (and its dark.css twin). Overriding one at the document root — or on any ancestor — re-skins every list.

Root (<dl>, both modes) ​

TokenDescription
--origam-data-list---displayDisplay mode of the <dl>
--origam-data-list---overflowOverflow rule
--origam-data-list---gapGap between items
--origam-data-list---paddingPadding of the <dl>
--origam-data-list---background-colorBackground of the <dl>
--origam-data-list---colorInherited text color
--origam-data-list---border-radiusCorner radius

Avatar mode — __title / __text ​

TokenDescription
--origam-data-list__title---font-sizeTitle font size
--origam-data-list__title---font-weightTitle font weight
--origam-data-list__title---line-heightTitle line height
--origam-data-list__title---letter-spacingTitle letter spacing
--origam-data-list__title---colorTitle color
--origam-data-list__text---font-sizeText row font size
--origam-data-list__text---line-heightText row line height
--origam-data-list__text---letter-spacingText row letter spacing
--origam-data-list__text---colorText row color

KV mode ​

The separator is __kv (BEM child), not --kv: __kv is the block's child element, whereas -- would designate a state variant. Copying a --origam-data-list--kv---* spelling has no effect — the SCSS never reads it.

TokenDescription
--origam-data-list__kv---displayDisplay of the --mode-kv root
--origam-data-list__kv---row-padding-blockVertical padding per row
--origam-data-list__kv---row-dividerColor of the 1px row divider
--origam-data-list__kv---key-widthWidth reserved for the key column
--origam-data-list__kv---key-colorKey (label) text color
--origam-data-list__kv---key-font-sizeKey font size
--origam-data-list__kv---key-font-weightKey font weight
--origam-data-list__kv---key-line-heightKey line height
--origam-data-list__kv---value-colorValue text color
--origam-data-list__kv---value-font-sizeValue font size
--origam-data-list__kv---value-line-heightValue line height
--origam-data-list__kv---gap-key-valueColumn gap between key and value
--origam-data-list__kv---value-inline-gapGap between inline value items (chips, …)
--origam-data-list__kv---row-columnsRow grid-template-columns (default: key-width + 1fr)
--origam-data-list__kv---row-gapRow gap between key and value when stacked
--origam-data-list__kv---row-padding-inlineRow inline padding
--origam-data-list__kv---row-radiusRow border radius
--origam-data-list__kv---row-backgroundRow background
--origam-data-list__kv---row-border-widthWidth of the row divider (default 1px)
--origam-data-list__kv---key-letter-spacingKey letter spacing
--origam-data-list__kv---key-text-transformKey text transform
--origam-data-list__kv---value-font-weightValue font weight
--origam-data-list__kv---value-font-variant-numericValue font-variant-numeric