Separator
Content separator. A simple <hr> by default, with an ornamental image variant available when an image is provided. Separators carry size and alignment values so they can serve as both plain rules and decorative section breaks (waves, ornaments, brand marks) without pulling in extra components.
Usage
When to use
- Between unrelated sections of page content where a visible separator helps the reader
- As an ornamental flourish between major sections of a long-form page
When not to use
- Between cards in a grid - spacing and card borders already do the job
- Between list items - use list spacing tokens instead
- To group form fields - use a
<fieldset>with<legend>
Do
- Prefer classless
<hr>for plain horizontal rules - Use the ornamental variant for deliberate decorative flourishes, not for every section break
- Mark decorative images
alt=""androle="presentation"
Don't
- Don't use a divider where whitespace alone would communicate the separation
- Don't stack multiple dividers for emphasis
- Don't omit the size and alignment values and then compensate with custom CSS
API
Slots
| Slot | Required | Description |
|---|---|---|
content | - | Optional inline markup for an ornamental separator. Consumers are responsible for accessibility attributes on the root element. |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
image | object | - | Optional image object with url and alt fields for an image separator. |
classes | array | - | Additional CSS class words merged into the root element. |
attributes | object | - | Additional HTML attributes spread on the root element. |
Classes
| Class | Capability | Default | Description |
|---|---|---|---|
.sm | Size | - | Small. |
.md | Size | Yes | Medium. |
.lg | Size | - | Large. |
.left | Alignment | - | Anchored to the left. |
.right | Alignment | - | Anchored to the right. |
.center | Alignment | - | Centered. |
Examples
Sizes
.sm, .md, .lg side by side.
Line
The plain rule, rendered as an <hr>.
Ornament
An SVG ornament in place of the plain rule, carrying role="separator" so it keeps the break semantics the <hr> form gets implicitly.
Image
A raster divider, carrying the same separator role as the ornament form for the same reason.
Accessibility
- WCAG 2.2 AA
<hr>has implicitrole="separator"- no extra ARIA.- Ornament image must be decorative:
alt=""androle="presentation".