SxTypography (排版)
- Implemented
提供标准化的文字展示样式。对齐 Microsoft Fluent UI Blazor Typography (v4.13.2) 的 API 结构,并说明 NextUI 当前实现状态。
使用场景
- 标题与正文排版
- 说明与提示文本
- 页面层级与信息结构
约束说明
ChildContent必须提供内容。- 使用
Variant控制字号与样式。
行为说明
- 变体通过 CSS 类控制样式层级。
API
Parameters
| 状态 | 参数名 | 类型 | 默认值 | 描述 |
|---|---|---|---|---|
| Implemented | Variant |
TypographyVariant |
Body |
排版变体。 |
| Implemented | ChildContent |
RenderFragment? |
null |
文本内容。 |
| Implemented | Id (继承) |
string? |
null |
组件的物理 Id。 |
| Implemented | Class (继承) |
string? |
null |
自定义 CSS 类名。 |
| Implemented | Style (继承) |
string? |
null |
自定义样式。 |
| Implemented | Title (继承) |
string? |
null |
HTML title 属性。 |
| Implemented | AdditionalAttributes (继承) |
IEnumerable<KeyValuePair<string, object>>? |
null |
捕获不匹配的 HTML 属性。 |
示例
<SxTypography Variant="TypographyVariant.H3">标题</SxTypography>
<SxTypography Variant="TypographyVariant.Body">正文内容</SxTypography>