---
title: "Separator"
description: "A hairline rule that separates content."
category: "Layout & Navigation"
slug: separator
url: /components/separator
since: "0.1.0"
status: "stable"
---

# Separator

A hairline rule that separates content.

## Import

```svelte
import { Separator } from '@elluzion/iv-ui';
```

## Preview

The default rule between stacked blocks.

```svelte
<script lang="ts">
	import { Separator } from '@elluzion/iv-ui';
</script>

<div class="stack">
	<p>Build finished in 42 seconds.</p>
	<Separator />
	<p>Deploy started from the release branch.</p>
</div>

<style>
	.stack {
		width: 100%;

		p {
			margin: 0;
			font-family: var(--iv_font-ui);
			font-size: var(--iv_text-body);
			color: var(--iv_foreground-dim);
		}
	}
</style>
```

## Usage

- `orientation="vertical"` needs a parent with a defined height.
- Add `label` for a centered caption on a horizontal rule.
- `spacing` controls the margin around the line.

## Examples

### Labeled

A centered caption splits the line into two segments.

```svelte
<script lang="ts">
	import { Separator } from '@elluzion/iv-ui';
</script>

<div class="stack">
	<p>Read access is inherited from the organization.</p>
	<Separator label="Write access" />
	<p>Members listed below can deploy and roll back.</p>
</div>

<style>
	.stack {
		width: 100%;

		p {
			margin: 0;
			font-family: var(--iv_font-ui);
			font-size: var(--iv_text-body);
			color: var(--iv_foreground-dim);
		}
	}
</style>
```

### Vertical

A vertical rule between inline items; the row provides the height.

```svelte
<script lang="ts">
	import { Separator } from '@elluzion/iv-ui';
</script>

<div class="row">
	<div class="cell"><span class="label">Build</span><span class="value">42s</span></div>
	<Separator orientation="vertical" />
	<div class="cell"><span class="label">Tests</span><span class="value">118</span></div>
	<Separator orientation="vertical" />
	<div class="cell"><span class="label">Size</span><span class="value">84 kB</span></div>
</div>

<style>
	.row {
		display: flex;
		align-items: stretch;
		padding: var(--iv_spacing-md) 0;
		width: 100%;
		max-width: 420px;
	}

	.cell {
		display: flex;
		flex-direction: column;
		gap: var(--iv_spacing-2xs);
		flex: 1;
	}

	.label {
		font-family: var(--iv_font-mono);
		font-size: var(--iv_text-xs);
		color: var(--iv_foreground-dim);
		text-transform: uppercase;
		letter-spacing: var(--iv_tracking-wide);
	}

	.value {
		font-family: var(--iv_font-mono);
		font-size: var(--iv_text-lg);
		color: var(--iv_foreground);
	}
</style>
```

### Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Line direction. |
| `label` | `string` | `''` | Optional text rendered in the middle of the line. |
| `spacing` | `'sm' \| 'md' \| 'lg'` | `'md'` | Vertical margin around the line. |
| `className` | `string` | `''` | Extra classes merged onto the root element. |

`class`, `id`, `style`, `aria-*`, and `data-*` are forwarded through rest props.

### Tokens used

`--iv_border` · `--iv_font-mono` · `--iv_foreground-dim` · `--iv_separator-size` · `--iv_spacing-2xl` · `--iv_spacing-lg` · `--iv_spacing-md` · `--iv_spacing-sm` · `--iv_text-sm` · `--iv_tracking-wide`

See the [token reference](/foundations/tokens.md) for values.

### CSS hooks

`.iv-horizontal` · `.iv-label-text` · `.iv-labeled` · `.iv-line` · `.iv-separator` · `.iv-spacing-lg` · `.iv-spacing-sm` · `.iv-vertical`

## Accessibility

- The element exposes `role="separator"` with the matching orientation.
- The label is visual text; it is not part of the accessible name.
- Decorative line segments are hidden from assistive technology.

## Related

- [Card](/components/card.md)
- [Breadcrumb](/components/breadcrumb.md)
- [Accordion](/components/accordion.md)
- [Article](/components/article.md)