Components
Separator
A horizontal or vertical rule, semantic or decorative.
Server-compatible (no "use client")
import.tsx
separator-basic.tsx
Edit on GitHubPurpose
Separator visually divides content. Semantic separators are announced as a thematic break;
decorative ones are hidden from assistive technology.
Import
import { Separator } from "@neshel-ui/components";Usage
Preview: separator-basic
Profile settings
DocsBlog
import { Separator } from "@neshel-ui/components";
import { Inline, Stack } from "@neshel-ui/layout";
import { Paragraph, Text } from "@neshel-ui/typography";
export default function SeparatorBasic() {
return (
<Stack space="4">
<Paragraph>Profile settings</Paragraph>
{/* Semantic: a thematic break that assistive technology announces. */}
<Separator />
<Inline space="3" alignY="stretch" className="h-6">
<Text>Docs</Text>
{/* Decorative: purely visual, hidden from assistive technology. */}
<Separator orientation="vertical" decorative />
<Text>Blog</Text>
</Inline>
</Stack>
);
}API
SeparatorProps
| Prop | Type | Default | Description |
|---|---|---|---|
| decorative | boolean | — | Purely visual: role="none" instead of role="separator". |
| orientation | "horizontal" | "vertical" | "horizontal" | Direction of the rule (default "horizontal"). |
| ref | Ref<HTMLDivElement> | — | — |
Also accepts the props of: React DOM attributes.
- Semantic (default):
role="separator", plusaria-orientation="vertical"when vertical. decorative:role="none".
Accessibility
Use the semantic form only when the division has meaning (between groups of content). Between items in
a toolbar or breadcrumb, use decorative.
Common mistakes
- A vertical separator in a container without height: give the row a height or
alignY="stretch". - For separators between Stack/Inline items, the layout
separatorprop is often simpler.