跳至正文

Typography 文字排版 ​

通过变体同时选择文字的语义元素和排版样式,适合标题、正文、引用与行内代码。

import { STypography } from '@icecreamqaq/shadcn/typography'

使用示例 ​

基础用法

常用 API ​

成员类型用法
STypography.variantTypographyVariant默认 p。可选 h1 至 h4、p、blockquote、list、code、lead、large、small、muted 或 table。
STypography.defaultslot传入文本或符合当前语义元素的子节点。list 变体可传入 li。
STypography.classHTMLAttributes["class"]追加间距、对齐或项目自定义排版类。

完整 API ​

Typography3 个成员

属性

名称类型
variant"h2" | "h3" | "p" | "list" | "table" | "muted" | "h1" | "h4" | "blockquote" | "code" | "lead" | "large" | "small"
classClassValue

插槽

名称类型
default((props: {}) => any)

分组导出 ​

模板标签为 <s-typography>。

组件 STypography

函数与常量 typographyStyles

类型 TypographyVariant