Divider
A horizontal or vertical line that separates content.
Usage
Basic
The default slot adds a label; textPlacement sets where it sits.
Loading demo...
Gradient
gradient takes start, end, or both; true equals both.
Loading demo...
Vertical
direction="vertical" separates inline content and also supports dashed and gradient.
Loading demo...
Best Practices
- Separate semantic sections, not every row; dense tables and lists use row spacing or table borders.
- Keep labels short; turn long text into a real heading.
- Use vertical dividers only in inline metadata or toolbars, where surrounding text already gives context.
- Inside Drawer, Card, and Form surfaces, use
TxDividerinstead of hard-coded borders.
API Reference
Props
| Property | Type | Default | Description |
|---|---|---|---|
| direction | Divider direction. | ||
| dashed | Renders a dashed line. | ||
| textPlacement | Label position on horizontal dividers. | ||
| gradient | Fade direction; true equals both. |
Slots
| Property | Type | Default | Description |
|---|---|---|---|
| default | - | - | Label text on horizontal dividers; not rendered when vertical. |
Overview
- The root is
role="separator", witharia-orientationtaken fromdirection. - Horizontal dividers span the container width; labels render only when horizontal.
startfades in from transparent,endfades out to transparent, andbothfades both ends around a solid middle; vertical dividers fade along the vertical axis.
Technologies
- Source:
packages/tuffex/packages/components/src/divider/.
查看源码
packages/tuffex/packages/components/src/divider/index.ts