Key Value
Compound component for displaying labeled data. KeyValue wraps one or more KeyValue.Item rows in a semantic description list.
Installation
dgadd is not public on npm yet. Until the first release, pack @diffgazer/add from the repository and install that tarball into this app, which is what puts dgadd on pnpm exec.
The hosted registry is not public yet because r.b4r7.dev does not resolve. Use this source checkout or a local registry preview until the endpoint returns 200.
Diffgazer packages are not yet published to npm. Until the first release, pack @diffgazer/ui and @diffgazer/keys from the repository and install those tarballs.
UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS once packages are available.
Usage
Examples
Variants
Description
Bordered
List
API Reference
KeyValue
KeyValue.Item
Accessibility
Notes
When to use KeyValue vs Label
Use KeyValue for structured multi-row data display (metadata panels, commit info). Use Label for form field labeling.
Compound Usage
Always wrap KeyValue.Item inside KeyValue — this produces a proper <dl> list. For a single pair: <KeyValue><KeyValue.Item label='...' value='...' /></KeyValue>.
Color Variants
5 semantic color variants (default, warning, info, success, error) style the value text. The info variant renders monospace in the info color instead of bold.
Bordered Rows
Set bordered on KeyValue or KeyValue.Item to add top separators between rows, vertical padding, and compact text-xs sizing — ideal for stacked list layouts.
Layout Options
Horizontal layout (default) places label and value side-by-side. Vertical layout stacks them with a small gap. Both label and value accept ReactNode.
Descriptions
Pass description to qualify a pair with a line of muted copy. It renders as a second <dd> for the same <dt>, spanning the full row in horizontal layout — so callers never have to restate the grid's column count.
Class Slots
KeyValue.Item renders up to three elements: className (and every other forwarded prop) lands on the <dt>, valueClassName on the value <dd>, descriptionClassName on the description <dd>. All preserve the <dl>/<dt>/<dd> structure.
Source
Install via CLI: pnpm exec dgadd add ui/key-value.
Highlighted source loads after this disclosure opens. Browse the source repository.