# Separator

A semantic or decorative rule between related content.

A semantic or decorative rule between related content.

```tsx
import { Separator, Stack, Text } from "@zentara-co/zenos-ui";

function SeparatorExample() {
  return (
    <Stack gap="4" className="w-full max-w-md rounded-lg border border-border-default p-4">
      <Stack gap="1">
        <Text weight="medium">Workspace activity</Text>
        <Text size="s" color="subtle">
          Changes made during the last seven days.
        </Text>
      </Stack>
      <Separator />
      <Stack direction="row" gap="4">
        <Text>18 deployments</Text>
        <Text>4 policy updates</Text>
      </Stack>
    </Stack>
  );
}
```

## Import

```tsx
import { Separator } from "@zentara-co/zenos-ui";
```

## Orientation

Horizontal separators divide stacked content. Vertical separators divide controls or labels arranged in a row; their parent must provide a height for the separator's `h-full` sizing.

```tsx
import { Button, Separator, Stack, Text } from "@zentara-co/zenos-ui";

function SeparatorOrientationsExample() {
  return (
    <Stack gap="6" className="w-full max-w-lg">
      <Stack gap="3">
        <Text weight="medium">Horizontal</Text>
        <Stack gap="3">
          <Text>General settings</Text>
          <Separator />
          <Text>Security settings</Text>
        </Stack>
      </Stack>

      <Stack gap="3">
        <Text weight="medium">Vertical</Text>
        <Stack direction="row" gap="3" align="center" className="h-6">
          <Button variant="ghost" size="sm">
            Edit
          </Button>
          <Separator orientation="vertical" />
          <Button variant="ghost" size="sm">
            Duplicate
          </Button>
          <Separator orientation="vertical" />
          <Button variant="ghost" size="sm">
            Archive
          </Button>
        </Stack>
      </Stack>
    </Stack>
  );
}
```

## Decorative and semantic

Separators are decorative by default and use `role="none"`. Set `decorative={false}` only when the boundary communicates a meaningful change between groups of content. Semantic separators expose `role="separator"` and their orientation to assistive technology.

```tsx
import { Separator, Stack, Text } from "@zentara-co/zenos-ui";

function SeparatorSemanticExample() {
  return (
    <Stack gap="4" className="w-full max-w-lg">
      <section aria-labelledby="current-plan-heading">
        <Stack gap="1">
          <Text as="h3" id="current-plan-heading" weight="medium">
            Current plan
          </Text>
          <Text color="subtle">Security Pro renews on October 24.</Text>
        </Stack>
      </section>
      <Separator decorative={false} />
      <section aria-labelledby="usage-heading">
        <Stack gap="1">
          <Text as="h3" id="usage-heading" weight="medium">
            Usage
          </Text>
          <Text color="subtle">18 of 25 member seats are assigned.</Text>
        </Stack>
      </section>
    </Stack>
  );
}
```

## Spacing and color

Separator does not add surrounding margin. Control spacing with the parent layout, and use `className` when a specific surface needs a different semantic border token.

## Variants

horizontal, vertical

## API

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| orientation | horizontal \| vertical | horizontal | Separator axis. |
| decorative | boolean | true | Controls semantic separator behavior. |
| native props | React.HTMLAttributes<HTMLDivElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

## Accessibility

Prefer the default decorative behavior when headings, lists, regions, or other structure already communicates the grouping. A semantic separator should reinforce a real content boundary rather than add noise to the accessibility tree. Separator is non-interactive and does not receive keyboard focus.

Source: https://zenos-ui.pages.dev/components/separator/