Separator
Visually or semantically separates content.
An open-source component library.
Separator is a thin line (border-b or border-l depending on orientation) that visually separates sections.
Installation
$ bext ui add separator
Copy and paste the following into src/components/ui/separator.tsx.
Usage
Anatomy
<Separator vertical? decorative? />
API Reference
Separator
| Prop | Type | Default | Description |
|---|---|---|---|
| vertical | boolean | — | If true: w-px h-full (vertical). Otherwise h-px w-full (horizontal, the default). |
| decorative | boolean | false | If true: role="none", the line is hidden from assistive technologies. Otherwise role="separator". |
| className | string | — | Extra classes on the line, for example a margin (my-4). |
Accessibility
By default Separator sets role="separator", so assistive technologies announce it as a boundary between two groups of content. The vertical form also sets aria-orientation="vertical" (horizontal is the implicit value of the role).
For a line that is only visual, pass decorative: the element gets role="none" and no aria-orientation, and is ignored by assistive technologies. This differs from shadcn, where the separator is decorative by default.
Edit this example live in the bext playground. It compiles and runs entirely in your browser.
On This Page