跳到主要內容

Divider 分割線

區隔內容的分割線。

基礎用法​

基礎用法
春水碧於天,畫船聽雨眠。壚邊人似月,皓腕凝霜雪。
垂直分割
上下
import { LhDivider } from '@lh-ui/react'

export default function Demo() {
return (
<>
<span>春水碧于天,画船听雨眠。</span>
<LhDivider />
<span>垆边人似月,皓腕凝霜雪。</span>
<LhDivider dashed />
<LhDivider labelPosition="left">左对齐分组</LhDivider>
</>
)
}

Divider Props​

屬性說明型別可選值預設值
direction方向'horizontal' | 'vertical'—'horizontal'
dashed是否虛線boolean—false
labelPosition文案位置(水平方向生效,垂直恆置中)'left' | 'center' | 'right'—'center'
borderStyle邊框樣式(顯式指定時優先於 dashed)string'solid' | 'dashed' | 'dotted' …—
sx快速版面配置屬性SxProps——
無障礙

帶文案的分割線渲染為 role="separator"(真分組語意);純裝飾的為 role="presentation",移出無障礙樹。僅「帶文案且垂直」時輸出 aria-orientation="vertical"。

已知行為

borderStyle="dotted" 會輸出 lh-divider--dotted 修飾符,但樣式層目前只實作了 --dashed,會回退為實線 —— 與 lh-ui-plus 行為一致。

樣式​

import '@lh-ui/react/style/divider'