Separator
import { Separator } from "@cherry-design-system/react";
export function Section() {
return (
<>
<p>Account</p>
<Separator />
<p>Billing</p>
</>
);
}Separator draws a 1px rule between groups of content. It can carry a short centered label such as "or". Inside a Menu use MenuSeparator instead.
Examples
With a label
The label shows only on a horizontal rule.
import { Button, Separator, Stack } from "@cherry-design-system/react";
export function SignIn() {
return (
<Stack>
<Button>Continue with email</Button>
<Separator label="or" />
<Button variant="outline">Continue with SSO</Button>
</Stack>
);
}Vertical
A vertical separator needs a parent with height, such as a Flex row.
import { Flex, Separator } from "@cherry-design-system/react";
export function Meta() {
return (
<Flex align="center" gap={3} wrap="nowrap">
<span>12 files</span>
<Separator orientation="vertical" decorative />
<span>4.2 MB</span>
</Flex>
);
}Properties
Direction of the rule. Defaults to "horizontal".
Centered text on a horizontal rule, such as "OR". Ignored on a vertical rule.
Purely visual: hidden from assistive tech (role="none"). Defaults to false.
Separator renders a <div> with no children of its own, forwards its ref and passes every other <div> attribute through. It is safe in Server Components.
Styling
| Hook | Values |
|---|---|
| Class | cherry-separator |
data-orientation | horizontal, vertical |
| States | data-labelled |
| Parts | cherry-separator__label |
The rule reads --cherry-border-default; the label uses the eyebrow text tokens and --cherry-fg-muted.
Accessibility
Separator has role="separator" (with aria-orientation="vertical" when vertical). Set decorative when the rule adds no meaning, so screen readers skip it.