# Separator

A thin line between groups that spacing alone does not separate, optionally with a short label.

- Family: display
- Import: `import { Separator } from "@senvenli/react/display";`
- Page: https://design.senvenli.com/docs/components/separator
- JSON: https://design.senvenli.com/docs/components/separator.json

## Example: Between groups

A line where space alone does not separate two groups.

```tsx
import { Separator, Text } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";

export default function Example() {
  return (
    <Stack space="space-200">
      <Stack space="space-050">
        <Text weight="medium">Billing address</Text>
        <Text tone="subtle">12 St James's Square, London</Text>
      </Stack>
      <Separator />
      <Stack space="space-050">
        <Text weight="medium">Shipping address</Text>
        <Text tone="subtle">Same as the billing address</Text>
      </Stack>
    </Stack>
  );
}
```

## Examples

### Vertical

Between items in a row; `decorative` hides a line that only decorates.

```tsx
import { Separator, Text } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";

export default function Example() {
  return (
    <Stack direction="horizontal" space="space-150" align="stretch">
      <Text>12 orders</Text>
      <Separator orientation="vertical" isDecorative />
      <Text>3 customers</Text>
      <Separator orientation="vertical" isDecorative />
      <Text>$1,240.00</Text>
    </Stack>
  );
}
```

### With a label

For the alternative on an auth form, not for section titles.

```tsx
import { Button } from "@senvenli/react/action";
import { Separator } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";

export default function Example() {
  return (
    <div className="max-w-sm">
      <Stack space="space-200">
        <Button iconBefore="key-round">Continue with single sign-on</Button>
        <Separator>or continue with email</Separator>
        <Button variant="primary">Continue with email</Button>
      </Stack>
    </div>
  );
}
```

## Guidelines

### When to use it

- Two groups of content need a visible boundary.
- An "or" between alternative sign-in methods.

### Use something else when

- [card](https://design.senvenli.com/docs/components/card.md): The groups are separate objects; give each its own card.

### Do and avoid

- Prefer space over lines; add a separator only when space is not enough.

## Accessibility

Built in:

- Exposed as a separator with its orientation.

You provide:

- `decorative` when the line only decorates.

## API reference

### Separator

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| orientation | `"horizontal" \| "vertical"` | `"horizontal"` | no |  |
| children | `React.ReactNode` |  | no | A label in the line ("or continue with email"), for auth forms only, not section titles. Always horizontal. |
| isDecorative | `boolean` |  | no | Hides it from assistive tech when it only decorates. |

### Tokens it reads

`--ds-border`, `--ds-space-150`, `--ds-text-subtlest`
