Components

KeyValueList

Renders a list of key-value pairs in a definition-list style, suitable for metadata or property panels.

Category: Data Display / Standalone

Import

import {
  KeyValueList,
  type KeyValueListProps,
  type KeyValueItem,
} from "@hareru/ui"

Exports

NameTypeDescription
KeyValueListComponentKey-value pair list
KeyValueListPropsTypeProps interface
KeyValueItemType{ label: string; value: ReactNode }

Key Props

PropTypeDefaultDescription
itemsKeyValueItem[]Array of key-value items (required)

Types

interface KeyValueItem {
  label: string
  value: ReactNode
}

Usage

import { KeyValueList, Badge } from "@hareru/ui"

<KeyValueList
  items={[
    { label: "Company", value: "MUSUBI Inc." },
    { label: "Role", value: "CEO" },
    { label: "Location", value: "Tokyo, Japan" },
    { label: "Status", value: <Badge>Active</Badge> },
  ]}
/>

Notes

  • Renders each item as a ReadonlyField component internally.
  • Items are keyed by their label value — labels should be unique within a list.
  • value accepts ReactNode for rich content (badges, links, etc.).

On this page