---
title: Separator
description: Divide content regions with an oriented semantic line.
package: moraine
version: 0.11.0
repository: https://github.com/subframe7536/moraine
---

# Separator

> Divide content regions with an oriented semantic line.

## Anatomy

```text
Separator [component; slot=root; <div role="separator">]
```

## Usage

Use Separator to divide related regions with a visible line. Choose its orientation to match the
layout boundary. For a divider inside [ButtonGroup](https://moraine.subf.dev/components/button-group.md), use
`ButtonGroup.Separator` so orientation follows the group.

```tsx
import { Separator } from 'moraine'

export function Example() {
  return <Separator />
}
```

### Semantic orientation

Every `Separator` sets `role="separator"`, `aria-orientation`, and `data-orientation`. The default
orientation is `horizontal`, a full-width line. Use `vertical` between items in a row; it draws a
full-height line, so give the row a height.

```tsx
<Separator />
<Separator orientation="vertical" />
```

### Root styling

`Separator` has one `<div>` root. Use `class` and `style` for a local override, or configure
`separator.base.root` in your Theme for application defaults. `root` is the only slot, so `classes`
and `styles` only duplicate `class` and `style`.

```tsx
<Separator class="bg-blue-500" style={{ height: '3px' }} />
```

## Examples

### Divide a product heading from related links

Use a horizontal rule under a title, then vertical rules between inline destinations.

```tsx
import { Separator } from 'moraine'

export function SeparatorUsage() {
  return (
    <div class="max-w-md w-full space-y-4">
      <div>
        <h4 class="text-sm font-medium">Moraine UI</h4>
        <p class="text-xs text-muted-foreground">Accessible SolidJS component system.</p>
      </div>
      <Separator />
      <div class="text-xs flex gap-4 h-5 items-center">
        <span>Docs</span>
        <Separator orientation="vertical" />
        <span>Source</span>
        <Separator orientation="vertical" />
        <span>Releases</span>
      </div>
    </div>
  )
}
```

## API Reference

### Attributes

| Attributes | Slot | Description |
| --- | --- | --- |
| `data-orientation` | `separator` | Stores the rendered orientation (horizontal or vertical). |

### Props

Props for the Separator component.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| orientation | 'horizontal' \| 'vertical' \| undefined | 'horizontal' | `horizontal` draws a full-width line; `vertical` draws a full-height line for use between items in a row, and sets `aria-orientation`. |
| class | SlotClassValue \| undefined | — | Class applied to the component root or trigger element. |
| classes | Classes \| undefined | — | Family slot class defaults for this instance. |
| style | SlotStyleValue \| undefined | — | Style applied to the component root or trigger element. |
| styles | Styles \| undefined | — | Family slot style defaults for this instance. |
