# value-preview

- 分组：组合组件（Composite）
- 页面：/components/value-preview
- 源码：packages/react/src/components/value-preview.tsx

## 导出

```ts
import { JsonBlock, JsonPreview, ValuePopover } from "@modra/react";
```

## Props（JsonPreviewProps）

| 名称 | 必填 | 类型 | 说明 |
| --- | --- | --- | --- |
| `value` | 是 | `unknown` | Any JSON-serialisable value. Primitives render inline; objects and arrays are summarised. |
| `mode` | 否 | `"popover" \| "inline"` | `popover` (default) shows a short "N 项" / "N 个字段" trigger. `inline` renders the formatted JSON block directly, which suits detail pages. |
| `label` | 否 | `React.ReactNode` | Override the trigger label. |
| `title` | 否 | `React.ReactNode` | Heading for the popover. |
| `space` | 否 | `number` | Indentation passed to JSON.stringify. Defaults to 2. |
| `copyable` | 否 | `boolean` | Shows a copy button next to the formatted JSON. Defaults to true. |
| `disabled` | 否 | `boolean` |  |
