Heading 标题
Typography
展示型
简介
一个用于以一致的样式显示标题的多态组件。
用法
Page Title
import { Heading } from "../components/ui";
export default function MyPage() {
return (
<Heading as="h1" size="3xl">
Page Title
</Heading>
);
}
CMS 页面构建器
该组件在 页面构建器(content/pages/*.json)中作为 heading 区块提供:
{
"type": "heading",
"text": "Page Title",
"as": "h1",
"size": "3xl"
}
属性
| 属性 | 类型 | 说明 |
|---|---|---|
children | any | 文本或内容。 |
class | string | 自定义 CSS 类名。 |
as | string | 要渲染的 HTML 元素(例如 "h1"、"h2")。默认 "h2"。 |
size | string | 字体大小变体。 |
interactive | boolean | 是否启用客户端水合。 |