外观
Typography 文字排版
通过变体同时选择文字的语义元素和排版样式,适合标题、正文、引用与行内代码。
import { STypography } from '@icecreamqaq/shadcn/typography'使用示例
常用 API
| 成员 | 类型 | 用法 |
|---|---|---|
STypography.variant | TypographyVariant | 默认 p。可选 h1 至 h4、p、blockquote、list、code、lead、large、small、muted 或 table。 |
STypography.default | slot | 传入文本或符合当前语义元素的子节点。list 变体可传入 li。 |
STypography.class | HTMLAttributes["class"] | 追加间距、对齐或项目自定义排版类。 |
完整 API
Typography3 个成员
属性
| 名称 | 类型 |
|---|---|
variant | "h2" | "h3" | "p" | "list" | "table" | "muted" | "h1" | "h4" | "blockquote" | "code" | "lead" | "large" | "small" |
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
分组导出
模板标签为 <s-typography>。
组件 STypography
函数与常量 typographyStyles
类型 TypographyVariant