---
title: "Separator"
description: "A line between groups of content, horizontal or vertical: solid, dashed, dotted, double, or fade, in any status tone, with an optional label in the middle."
url: https://gelatinui.com/components/separator
markdown_url: https://gelatinui.com/components/separator.md
access: free
install: "npx shadcn@latest add @gelatin-ui/separator"
registry_item: https://gelatinui.com/r/separator.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Separator

> A line between groups of content, horizontal or vertical: solid, dashed, dotted, double, or fade, in any status tone, with an optional label in the middle.

Page: https://gelatinui.com/components/separator

## When to use it

Best for: A line between groups of content, horizontal or vertical, with an optional label.

- Use it when a line makes a group easier to see.
- Use `orientation="vertical"` between items of a row.
- Use `variant` for `solid`, `dashed`, `dotted`, `double`, or `fade`, and `tone` for the color.
- Pass `children` to put a label in the middle.

## When not to use it

- When space alone groups the content, use space and no line.
- For a wavy, zigzag, or stitched line, use the Decorative Separator.

## Notes for agents

- A vertical line fills the height of the row. Next to text or icons, add `h-4 self-center` to make it shorter.
- A horizontal line fills the width. The gap of the parent sets the space on each side.
- A string label becomes the `aria-label` of the separator.
- A `className` replaces a size or an alignment through `tailwind-merge`.

## Anatomy

```text
Separator
```

## API reference

### Separator

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `variant` | `"dashed" \| "dotted" \| "double" \| "fade" \| "solid"` | "solid" | The line pattern. Default: `solid`. |
| `tone` | `"default" \| "destructive" \| "info" \| "muted" \| "primary" \| "success" \| "warning"` | "default" | The color, from the shared tokens. Default: `default` (the border color). |
| `children` | `ReactNode` |  | Content in the middle of a horizontal line: "or", a date, an icon. The line then splits in two halves around it, and a text label is the name that screen readers hear. |

Also takes every prop of Base UI `Separator`: https://base-ui.com/react/components/separator

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Separator | `separator` |  |  |  |

## Usage

A horizontal line fills the width, and the gap of the parent sets the space on each side.

```tsx title="docs-links.tsx"
import { Separator } from "@/components/ui/separator";

export function DocsLinks() {
  return (
    <div className="flex h-5 items-center gap-3 text-sm">
      Docs
      <Separator orientation="vertical" />
      Changelog
    </div>
  );
}
```

## Compose

Rules:

- Group with a Frame (`group-in-frames`): Put related panels in one `Frame` with its header and footer outside the panels, and keep a plain `Card` for one block of content.
- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/separator
```

It adds 4 registry items: 3 files, 368 lines, and the npm packages `@base-ui/react`, `clsx`, `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Kbd](https://gelatinui.com/components/kbd.md)
- [Typography](https://gelatinui.com/components/typography.md)
- [Field](https://gelatinui.com/components/field.md)

## Accessibility

It is a Base UI Separator with `role="separator"` and the right `aria-orientation`.

A string label becomes the `aria-label` of the separator.
