Skip to Content
OpenPerf

Components

Key value

Description list with a fixed-width key column that stacks on narrow screens and wraps long keys and values.

import { KeyValue } from "@openperf/deft";

<KeyValue.Root keyWidth={128}>
  <KeyValue.Item label="service.name">checkout</KeyValue.Item>
  <KeyValue.Item label="environment">production</KeyValue.Item>
</KeyValue.Root>;

When to use

NeedComponent
Attributes of one object, each spelled out with a keyKey value
Curated facts where an icon stands in for the keyProperty
A few short numbers in a rowStat
Many objects with the same attributesTable

Layout

CaseBehaviour
Key column188px wide for every item; change it with keyWidth on the root
Viewport below 900pxEach key moves above its value
Long keyA string label may break after each dot, as in service.name
Long valueBreaks at any character, so ids and URLs stay inside their column
Several columns of pairsThe root is a single column; give it a grid through className

The value is any node, such as a link.

API

KeyValue.Root

Prop

Type

KeyValue.Item

Prop

Type

On this page