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
| Need | Component |
|---|---|
| Attributes of one object, each spelled out with a key | Key value |
| Curated facts where an icon stands in for the key | Property |
| A few short numbers in a row | Stat |
| Many objects with the same attributes | Table |
Layout
| Case | Behaviour |
|---|---|
| Key column | 188px wide for every item; change it with keyWidth on the root |
Viewport below 900px | Each key moves above its value |
| Long key | A string label may break after each dot, as in service.name |
| Long value | Breaks at any character, so ids and URLs stay inside their column |
| Several columns of pairs | The 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