# Separator

A 1 px neutral/divider line between groups of content. Built on ui-sdk's Separator: announced as a separator unless decorative.

- Beta: ready to use; its API can still change in a minor release.
- Category: Layout & surfaces

```tsx
import { Separator } from "@leap-crm/design-system";
```

## Best practices

- Do: Try space first. Add a separator only where spacing alone doesn't show that two groups are separate, like a contact's name and their notes.
- Do: Set `decorative` when nearby text already says the parts are separate, so a screen reader skips the line.
- Do: Use `orientation="vertical"` between groups in a row, like toolbar buttons. It takes the row's height.
- Don't: Put a separator between every row of a list. Use `List` with `dividers`, or `Table`, which draws its own rules.
- Don't: Thicken or colour a separator to make a section stand out. Use `SectionHeader`, so weight and size carry the hierarchy.

## Related

- [Section Header](./section-header.md)
- [Toolbar](./toolbar.md)

## Examples

What the examples import:

```tsx
import { Separator } from "@leap-crm/design-system";
```

### Horizontal

```tsx
<div className="flex w-80 flex-col gap-3">
  <div>
    <p className="font-book text-base">Jane Citizen</p>
    <p className="text-small text-neutral-text-muted">
      jane@citizen.com.au
    </p>
  </div>
  <Separator />
  <p className="text-body text-neutral-text-secondary">
    Prefers email. Settlement booked for 14 December.
  </p>
</div>
```

### Vertical

```tsx
<div className="text-body flex items-center gap-3">
  <span>Contacts</span>
  <Separator orientation="vertical" />
  <span>Opportunities</span>
  <Separator orientation="vertical" />
  <span>Insights</span>
</div>
```

### Between rows

Lines between rows of details are decorative, so a screen reader doesn't announce a separator after every row.

```tsx
<div className="text-body flex w-80 flex-col gap-2">
  {[
    ["Matter type", "Conveyancing"],
    ["Responsible", "Ada Hartley"],
    ["Value", "$48,000"],
  ].map(([term, detail], index) => (
    <div key={term} className="flex flex-col gap-2">
      {index > 0 && <Separator decorative />}
      <p className="flex justify-between">
        <span className="text-neutral-text-muted">{term}</span>
        <span>{detail}</span>
      </p>
    </div>
  ))}
</div>
```

## Props

Also takes every prop of ui-sdk's Separator: orientation (horizontal or vertical) and decorative.

No props of its own.
