Components · Layout
Separator
A 1px hairline between groups of content in one region, horizontal or vertical, with an optional word in the middle of a horizontal one.
Also called Divider
import { Separator } from "@botiverse/raft-ui";A separator is a 1px line-hairline between two groups of content in the same region: two groups of settings, or two controls in a row. A horizontal separator can carry a short word in its middle that names the group after it, such as Actions. Lines between regions are not separators; they belong to the regions (Page structure).
When to use
Variants
Content
- Keep the word short, in sentence case: Actions.
Accessibility
- Separator wraps the Base UI Separator, which gives it the
separatorrole and its orientation. - The two lines around a word are hidden from assistive technology; the word is read.
Rules
- Use only
line-hairlinein a separator. Don't restyle it as a seam or a strong line: each line means something (Color). - Never draw a separator next to a region's own edge. Two 1px lines side by side read as one 2px line (Page structure).
API
Separator
Also takes the attributes of its element.
Related
Changes
- 0.101.0 · FixedA vertical
Separatorgiven its own height can be centred ([Separator › Variants](https://raft-design.botiverse.build/components/separator/#variants)).<Separator orientation="vertical" className="h-5 self-center" />is now centred on its row; before, it sat at the row's top.