SxHeader (顶栏)
- Implemented
NextUI 核心布局组件。应用顶部的全局容器。
使用场景
- 应用顶栏与导航区域
- 品牌与主操作入口
- 页面级标题与搜索
约束说明
- 仅提供布局容器,不包含默认内容。
- 高度由
Height控制。
行为说明
- 背景色通过
Background控制,支持 CSS 值。
API
Parameters (参数)
| 状态 | 参数名 | 类型 | 默认值 | 描述 |
|---|---|---|---|---|
| Implemented | ChildContent |
RenderFragment? |
null |
顶栏内容。 |
| Implemented | Background |
string? |
null |
背景色 (CSS)。 |
| Implemented | Height |
string |
"64px" |
物理高度。 |
| 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 属性。 |
示例
<SxHeader Background="var(--sx-colorNeutralBackground1)">
<SxTypography>应用标题</SxTypography>
</SxHeader>