Divider
Divider 用于分割页面区域。支持 3 种 variant、横向/纵向 两种方向,可带文字。
基础 Variants
Solid
Dashed
Dotted
<Divider appearance={{ variant: 'solid' }} content={{ text: 'Solid' }} />
<Divider appearance={{ variant: 'dashed' }} content={{ text: 'Dashed' }} />
<Divider appearance={{ variant: 'dotted' }} content={{ text: 'Dotted' }} />
方向
Horizontal
Vertical
<Divider appearance={{ orientation: 'horizontal' }} content={{ text: 'Horizontal' }} />
<Divider appearance={{ orientation: 'vertical' }} />
Props 参考
state — 运行时状态
| Prop | 类型 | 默认值 | 说明 |
|---|---|---|---|
state.dashed | boolean | — | 虚线样式(已由 appearance.variant 替代) |
appearance — 视觉外观
| Prop | 类型 | 默认值 | 说明 |
|---|---|---|---|
appearance.variant | 'solid' | 'dashed' | 'dotted' | 'solid' | 线条样式 |
appearance.orientation | 'horizontal' | 'vertical' | 'horizontal' | 分割线方向 |
appearance.flexItem | boolean | false | 在 flex 容器中作为 flex item |
content — 渲染内容
| Prop | 类型 | 默认值 | 说明 |
|---|---|---|---|
content.text | React.ReactNode | — | 分割线上的文字(优先) |
content.children | React.ReactNode | — | 分割线上的文字(备选) |
interaction — 事件回调
无。
override — 样式覆盖(所有组件必有)
| Prop | 类型 | 默认值 | 说明 |
|---|---|---|---|
override.className | string | '' | 自定义 className |
override.style | CSSProperties | — | 内联样式 |
a11y — 无障碍(所有组件必有)
| Prop | 类型 | 默认值 | 说明 |
|---|---|---|---|
a11y.ariaLabel | string | — | 无障碍标签 |
a11y.role | AriaRole | 'separator' | ARIA role(自动设置) |
native — 原生 HTML 属性
透传到 <div> 元素。