MenuChevron Down
Heading 标题 - Docs - Artefact

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"
}

属性

属性类型说明
childrenany文本或内容。
classstring自定义 CSS 类名。
asstring要渲染的 HTML 元素(例如 "h1"、"h2")。默认 "h2"。
sizestring字体大小变体。
interactiveboolean是否启用客户端水合。