请求卡 <VerbCards />
3–4 张卡片,各有一个方法徽章(PUT/GET…)、请求行和一句说明;每按一次 → 一张卡底部像小票一样打出响应行。
Template and style descriptions are currently available in Chinese only.
- Group
- 接口 · 3–4 个操作
- Component
VerbCards·#verb-cards- Interaction
- build: reveal 时每步打出一张卡的响应
Good for
- 介绍一个 API 的几个核心操作
- 每个操作都有“请求 → 响应”
Avoid when
- 要展示完整代码:用 Terminal 或 CodeDiff
- 操作超过 4 个:拆页
Content limits
| 1 | cards 3–4 张 |
| 2 | verb ≤ 6 个拉丁字符;path ≤ 28 个拉丁字符 |
| 3 | body ≤ 30 字;reply ≤ 28 个拉丁字符 |
Fields
| Field | Type | |
|---|---|---|
kicker · required | string | 标题上方的小节名,2–8 字 |
title · required | string | string[] | 页面标题;传数组可手动断行,每项一行 |
lead | string | 一到两句导语,≤ 60 字 |
source | string | 事实出处;页面上有任何数据或事实时必填 |
hint | ReactNode | 页眉中间的操作提示,可用 <kbd> |
cards · required | { verb, path, body, reply }[] | 每个操作一张 |
Example
<VerbCards kicker="S3 API" title="…" cards={[{ verb: 'PUT', path: 'PUT /photos/a.jpg', body: '…', reply: '200 OK' }, …]} source="…" />