Separator
A thin rule that divides content into groups.
@garn/ui/separatorDefault
Horizontal + vertical.
garn
A Radix + Tailwind design system.
Installation
garn is copy-in — the garn CLI writes this component's source into your project, so you own and can edit it. It resolves any base files and installs the npm dependencies below for you.
npx garn-ui add separator- Registry
separator- Source
- separator.tsx
- Deps
@radix-ui/react-separator- Registry deps
utils
Import
import { Separator } from "@garn/ui/separator";Props
Generated from the component's TypeScript types.
No component-specific props — this is a thin wrapper over its native element.
Styling
Target these data-slots and remap these tokens to restyle without forking the component.
[data-slot="separator"]Overview
Separator draws a thin rule that divides content groups — between list items, sections, or toolbar clusters — horizontally or vertically. It's a lightweight visual boundary, decorative by default (so it's skipped by assistive tech) but able to carry a semantic separator role when the division is meaningful. When the goal is just breathing room, use spacing; when it's a named section boundary, a heading communicates more.
Guidelines
Separate only when grouping isn't already clear. Whitespace usually does the job; add a rule when adjacent groups would otherwise blur together (toolbar clusters, a menu's sections). A page sliced by lines everywhere reads busier, not clearer.
Pick the right semantics. Leave it decorative when it's purely visual; mark it a real separator only when it represents a genuine content boundary that a screen-reader user should perceive. Don't use a separator as a heading substitute.
Match orientation and weight to context. Vertical separators divide inline clusters (toolbar groups), horizontal ones divide stacked sections. Keep it a hairline on a token border color — a heavy divider competes with the content it's meant to organize.
Best practices
- Use
orientation="vertical"inside a flex row (the parent needs a height). - Set
decorative={false}when the separation carries meaning for assistive tech.
- Don't use a separator purely for margin.
- Don't stack multiple separators for thickness.
Content guidelines
- Most separators are decorative and need no label; name one only when it bounds a titled section.
Accessibility
- Role
separator
- • `decorative` defaults to true → it's hidden from the a11y tree (purely visual).
- • Set `decorative={false}` to expose role=separator + aria-orientation when the divide is meaningful.
- Status
- Stable
- Version
v0.3.0- Introduced
v0.1.0
garn doesn't yet record a per-release version history. This reflects the component's current lifecycle state; full changelog entries will appear once the metadata pipeline emits a lifecycle.history field.