- 超宽横向滚动,不换行。
- 行号
subtle,只在超过 10 行时显示。 - 差异(diff):新增行
success-soft底、删除行destructive-soft底,行首 + / −。 - 移动端字号不小于 13。
消费者提供:代码、语言、是否显示行号、diff 标记。
代码、SQL、日志、生成的表结构。muted 底、radius-md、code 13 / 20 mono、内距 space-3 space-4;顶部一行 meta:语言 / 文件名,右侧复制图标。不做彩色语法高亮——只用 foreground 与 muted-foreground 两级(注释、字符串弱化)。
subtle,只在超过 10 行时显示。success-soft 底、删除行 destructive-soft 底,行首 + / −。消费者提供:代码、语言、是否显示行号、diff 标记。
import { CodeBlock } from "@wutong/ui";
两级灰不做彩色高亮;+ / − 行标 diff
create table inspection_record (
id bigserial primary key,
device_id bigint not null, -- 设备
- status text,
+ status text not null default 'pending',
handled_at timestamptz
);
| 属性 | 类型 | 默认 | 说明 |
|---|---|---|---|
| code / title | string | — | 代码与顶部标签(语言或文件名) |
| lineNumbers | boolean | — | 超过 10 行时开 |
| diff | boolean | — | 以 + / - 开头的行标色 |