DataList

Data Display
stable

Semantic description list (<dl>) with two layout modes: avatar (icon + title/text stacked) and kv (key/value rows aligned side-by-side).

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamDataListSchematic of the DataList component in avatar mode and kv mode. mode="avatar" mode="kv" 1 av. 2 Alice Martin 3 alice@example.com 4 1 Status Active 5 6
Anatomy of <origam-data-list> in avatar mode (left) and kv mode (right). Avatar mode renders a <dl> with <dt> titles and <dd> text rows. KV mode renders a key/value grid layout.
1.origam-data-list
Root element. Renders as <dl> in avatar mode, <div> in kv mode. Background, padding and border-radius from tokens.
2.origam-data-list__title
<dt> element. Hosts the OrigamDataTitle with its prepend avatar/icon and text. Only in avatar mode.
3.origam-data-list__text (first)
<dd> elements. Each text row rendered by OrigamDataText. Stacked below the title in avatar mode.
4.origam-data-list__text (nth)
Additional text rows. Multiple rows are stacked vertically within the item.
5.origam-data-list__kv-value
<dd> element for the value in kv mode. Right-aligned. Accepts inline components (Chip, Avatar…).
6.origam-data-list__kv-key
<dt> element for the key in kv mode. Width fixed by --origam-data-list__kv---key-width. Muted colour.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

mode
TDataListMode
'avatar'
Layout mode. 'avatar' renders icon+title/text stacks; 'kv' renders key/value rows aligned side-by-side.
items
| Array<IDataItem> | { [key: string]: IDataItem } | Array<IDataListKVItem> | { [key: string]: IDataListKVItem }
Data source. Shape depends on mode: avatar items use IDataItem; kv items use IDataListKVItem. Accepts arrays or keyed objects.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
appendAvatar
string
appendIcon
TIcon
prependAvatar
string
Default avatar image URL for every item prepend area.
prependIcon
Default icon for every item prepend area (can be overridden per-item).
prependAriaLabel
string
appendAriaLabel
string
color
Text/foreground colour applied to the list.
bgColor
Background colour of the list.
margin
boolean | number | string
Margin shorthand applied to the list container.
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
padding
boolean | number | string
Padding shorthand applied to the list container.
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
density
'default'
Vertical padding density for each item.
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
false
Adds a border around the list and bottom dividers between items.
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
Border-radius token applied to the list container.
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
elevation
TElevation
Box-shadow elevation of the list container.
fontSize
TFontSize
fontWeight
TFontWeight
lineHeight
TLineHeight
letterSpacing
TLetterSpacing

API

Slots

Emplacements de contenu exposés par ce composant.

#default
Full override of the list content. Use when the items prop is not sufficient.
#key
#value
#item
#item.title
Custom title renderer for avatar-mode items. Receives the item data and its index.
#item.title.append
Custom append area inside the title row (avatar-mode).
#item.title.prepend
Custom prepend area inside the title row (avatar-mode).
#item.text
Custom text renderer for each text row inside an avatar-mode item.
#item.text.append
#item.text.prepend

API

Membres exposés

Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props.
Ref<string>
Reactive CSS string for the injected style sheet.
string
Unique style-sheet ID for this instance.
() => void
Injects the style sheet into the document.
() => void
Removes the style sheet from the document.
Ref<boolean>
True once the style sheet has been injected.

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

Root list background colour.
Root list foreground colour.
List container border-radius.
Font size of avatar-mode title rows.
Font weight of avatar-mode title rows.
Text colour of avatar-mode title rows.
Fixed width of the key column in kv mode.
Text colour of kv-mode keys.
Text colour of kv-mode values.
Bottom border colour between kv rows.

Inclusion

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

term
definition

Notes

  • Avatar mode renders a semantic <dl> with <dt> (term/title) and <dd> (definition/text) elements. This provides native screen-reader association between key and value without ARIA.
  • KV mode also uses <dl>/<dt>/<dd> structure, which is the recommended HTML pattern for key/value pairs. Do not use a <table> unless the data is truly tabular (multiple columns with a column header).

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

Source
color
var(--origam-color__surface---default)
Root list background.
fontWeight
var(--origam-font__weight---medium)
Title row font weight.
dimension
160px
Fixed width of the key column in kv mode.
color
var(--origam-color__border---subtle)
Row bottom border colour in kv mode.
color
var(--origam-color__surface---overlay)
Item background on hover.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Avatar mode (default)

vue

Key/value mode

vue

Custom title slot

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.