Separator
A hairline divider: horizontal or vertical, optionally with a centered label, in two weights.
Live demo
Separator draws a thin dividing rule between content. It runs horizontal (a full-width rule, the default) or vertical (a full-height rule for inline groups like toolbars and button clusters), in two weights: normal uses the standard line color and thin uses the fainter --line-2.
The with-label variant centers a label over the rule, splitting it into two segments that flank the text (the classic "OR" divider), and works on both axes. A bare divider is decorative and aria-hidden; once it carries a label it becomes a real role="separator" so assistive tech announces the section break.
When to use
How this component composes with the rest of the set.
Props
3 props, straight from the manifest.
| Prop | Type | Default | Bindings | Description |
|---|---|---|---|---|
Appearance
Variants
default
A plain dividing rule with no label: decorative and aria-hidden.
with-label
Centers a label over the rule, splitting it into two flanking segments; promoted to role="separator".
Sizes
thin
Faint: drawn in the lighter --line-2.
normal
Default: the standard --line weight.
States
vertical
Vertical orientation: the rule spans height instead of width, for inline groups.
Anatomy
The named parts that make up the component, with their selectors.
separator
The root element. Bare, it is the rule itself; labeled, it is a flex track whose pseudo-elements draw the rule on either side of the label.
label
The centered label text shown in the with-label variant, flanked by rule segments.
Tokens & coverage
What the component consumes, checked live against what the algorithm produces.
Live coverage check against the xoji-default register
(derive(xojiDefault, { anchors }) →
coverComponent(manifest, register)). Every token this component
consumes must be a key the algorithm produces.
--border-thin
--fg-2
--font-sans
--leading-tight
--line
--line-2
--space-2
--space-3
--text-xs
--weight-medium
Slots
The label text, shown only in the with-label variant.
Accessibility
Code
Orientations, weights, and the labeled divider
A default rule, the thin weight, the labeled "OR" divider, and a vertical rule inside an inline group.
<xoji-separator></xoji-separator>
<xoji-separator size="thin"></xoji-separator>
<xoji-separator variant="with-label">OR</xoji-separator>
<div style="display: flex; height: 1.5rem; align-items: center;">
<span>Edit</span>
<xoji-separator orientation="vertical"></xoji-separator>
<span>Share</span>
</div>
<script lang="ts">
import { Separator } from "@xoji/svelte";
</script>
<Separator />
<Separator size="thin" />
<Separator variant="with-label">OR</Separator>
<div style="display: flex; height: 1.5rem; align-items: center;">
<span>Edit</span>
<Separator orientation="vertical" />
<span>Share</span>
</div>
---
import { Separator } from "@xoji/astro";
---
<Separator />
<Separator size="thin" />
<Separator variant="with-label">OR</Separator>
<div style="display: flex; height: 1.5rem; align-items: center;">
<span>Edit</span>
<Separator orientation="vertical" />
<span>Share</span>
</div>