Utility
Terminal
█
divider-demo █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█Installation
$ pnpm dlx shadcn@latest add @termcn/opentui/divider
Usage
import { Divider } from "@/components/ui/divider";<Divider label="Section" />Examples
Vertical rule and label styling
Use dividerChar and height for vertical rules; titlePadding and labelColor adjust the labeled horizontal variant.
Terminal
█
divider-custom █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█import { Box } from "@/components/ui/box";
import { Divider } from "@/components/ui/divider";
export function DividerCustom() {
return (
<Box flexDirection="column" gap={1}>
<text fg="#666">Vertical dividerChar</text>
<Box flexDirection="row" gap={1}>
<Divider orientation="vertical" dividerChar=":" height={5} />
<text>Beside rule</text>
</Box>
<Divider
label="Labeled"
titlePadding={2}
labelColor="cyan"
color="gray"
/>
</Box>
);
}API Reference
Divider
| Prop | Type | Default |
|---|---|---|
variant | "single" | "double" | "bold" | "single" |
orientation | "horizontal" | "vertical" | "horizontal" |
color | string | - |
label | string | - |
labelColor | string | - |
dividerChar | string | - |
titlePadding | number | 1 |
padding | number | 0 |
height | number | 1 |
width | number | "auto" | "auto" |
On horizontal dividers, the rule uses OpenTUI border segments; dividerChar applies to vertical orientation.