Divider
A thin line that visually separates groups of related content, horizontally or vertically.
Overview
Dividers are visual elements used to separate and organize related content within an interface. They can be oriented horizontally or vertically to create clear distinctions between different sections, groups, or categories of information. Dividers help establish visual hierarchy and improve content scannability by providing clear boundaries between related elements. Vertical dividers can be used within toolbars to separate sections of icons.
Usage
forge-divider draws a thin separating line through a single vertical attribute — horizontal by default. Reach for it when content is complex enough that a visible line reads more clearly than whitespace alone; for simpler groupings, like a few related form fields, prefer spacing over a divider.
Rules
Basic usage
A horizontal line is the default — use it to separate stacked content.
A horizontal divider separating stacked content.
<div style>
<forge-divider>
</forge-divider>
</div>Vertical
Set vertical for a divider that separates inline items side by side instead of stacked ones.
A vertical divider separating two inline items.
<div class="flex items-center gap-medium">
<span>
Left
</span>
<forge-divider vertical>
</forge-divider>
<span>
Right
</span>
</div>Dividers are used to separate elements with a thin line, either vertically or horizontally.
import "@tylertech/forge/divider";| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
vertical | vertical | boolean | false | Controls if the divider is displayed vertically or horizontally. |
| Name | Description |
|---|---|
::part(root) | The root container element. |
| Name | Description |
|---|---|
--forge-divider-color | The color of the divider. |
--forge-divider-width | The width of the divider. |
--forge-divider-border-style | The border-style (dashed, solid) of the divider. |
--forge-divider-margin | The margin of divider. |
Screen reader behavior
forge-divider automatically applies role="separator". If the divider is purely decorative in a given context and shouldn’t be announced at all, add aria-hidden="true" to remove it from the accessibility tree.