Skip to main content

KeyValue

KeyValue displays a label (key) alongside its corresponding value, for read-only detail views.

Base
Custom component
Mantine
None — built here
Import
{ KeyValue } from '@multiconsult-group-products/design-system'
Source
src/components/KeyValue/KeyValue.tsx

Usage​

Navn

Ola Nordmann

size
md
lg
xl
Tooltip
React
<KeyValue label="Navn" value="Ola Nordmann" size="md" />

Props​

PropertyTypeAllowed valuesDefaultDescription
label*string——The key, rendered through FieldLabel.
value*ReactNode——The value, rendered in a Text whose font size and weight follow size.
sizeKeyValueSizemd · lg · xlmdSizes the value text only — 14px/400, 24px/500, 32px/500. The label never changes size.
tooltipstring——Explanation shown in a tooltip. The info icon is rendered only when this is set.
iconLabelstring—'Mer informasjon'Accessible name of the info icon. Name the field, e.g. 'Mer informasjon om navn'.

* Required

The label is a FieldLabel, and tooltip and iconLabel are passed straight through to it.

Accessibility​

KeyValue has no key/value semantics beyond its layout, and takes no role or other ARIA prop. When you set tooltip, set iconLabel to a name that includes the field. See Accessibility.