Skip to content

components/KeyValue

import { … } from 'zidane-ui'ui/src/components/KeyValue.tsx

Components#

KeyValueComponent#

Renders labelled values as a dl.

TypeScript
function KeyValue(props: KeyValueProps): Element
Parameters
NameTypeDescription
propsKeyValueProps

KeyValueProps.

Element
KeyValue props
NameTypeDefaultDescription
className?string

Extra classes on the list.

itemsreadonly KeyValueItem[]

The rows, in order.

layout?'grid' | 'split''grid'

grid lines the values up after the longest label. split sets each value at the row's end.

meta?boolean

Show the values in the metadata voice (mono, tabular, small, muted).

size?'label' | 'ui''label'

ui: values at the row step (13 px), as a view's rows read. Labels stay small and muted.

style?CSSProperties

Inline styles on the list.

ui/src/components/KeyValue.tsx:42

Interfaces#

KeyValueItemInterface#

One row of a KeyValue.

TypeScript
interface KeyValueItem
KeyValueItem properties
NameTypeDescription
id?string

A stable key. Default: the label when it is a string, else the index.

labelReactNode

What the value is.

valueReactNode

The value.

ui/src/components/KeyValue.tsx:9

KeyValuePropsInterface#

Props for KeyValue.

TypeScript
interface KeyValueProps
KeyValueProps properties
NameTypeDefaultDescription
className?string

Extra classes on the list.

itemsreadonly KeyValueItem[]

The rows, in order.

layout?'grid' | 'split''grid'

grid lines the values up after the longest label. split sets each value at the row's end.

meta?boolean

Show the values in the metadata voice (mono, tabular, small, muted).

size?'label' | 'ui''label'

ui: values at the row step (13 px), as a view's rows read. Labels stay small and muted.

style?CSSProperties

Inline styles on the list.

ui/src/components/KeyValue.tsx:19