---
title: Callout 提示框
description: 五种语义提示变体，带底色与左侧条。
---

Callout 在正文旁呈现提示信息。每种 `type` 对应一个语义令牌
（`--cpd-info`、`--cpd-warning` 等），驱动左侧条、`color-mix` 底色与默认图标。

## 变体

```ts
callout('对读者有帮助的补充说明。', { type: 'info', title: '注意' });
callout('继续之前需要先处理。', { type: 'warning', title: '警告' });
callout('操作失败，修复原因后重试。', { type: 'error', title: '错误' });
callout('操作已成功完成。', { type: 'success', title: '成功' });
callout('还有更简洁的做法。', { type: 'idea', title: '灵感' });
```

## 有标题与无标题

```ts
callout('带标题的提示——加粗标题位于正文上方。', { title: '提醒' });
callout(`无标题提示，默认 ${code('info')} 类型。`);
```

## 自定义图标

```ts
callout('默认图标被替换为自定义 SVG。', {
  type: 'warning',
  title: '自定义图标',
  icon: '<svg …>…</svg>', // 任意内联 SVG 字符串
});
```

## 参数

<PropsTable
  labels={{ prop: '参数', type: '类型', default: '默认值' }}
  type={{
    content: { type: 'string', required: true, description: '正文文本（第一个参数）。' },
    type: { type: "'info' | 'warning' | 'error' | 'success' | 'idea'", default: "'info'", description: '语义变体——驱动左侧条、底色与图标。' },
    title: { type: 'string', default: "''", description: '可选的加粗标题。' },
    icon: { type: 'string', default: '自动', description: '替换默认图标的原始 SVG 字符串。' },
  }}
/>

## 注意

- `content` 内的 Markdown 会被转义；需要富文本时请传入 HTML。
- 底色由 `color-mix(in oklab, var(--cpd-<type>) 10%, transparent)` 生成——
  每种变体单一语义令牌，与 Plumest 一致。
