Utility
AI
Terminal
Installation
pnpm dlx shadcn@latest add https://termcn.dev/r/divider.json
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
import { Box, Text } from "ink";
import { Divider } from "@/registry/ui/divider";
export default function DividerCustom() {
return (
<Box flexDirection="column" gap={1}>
<Text dimColor>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 | undefined |
label | string | undefined |
labelColor | string | undefined |
dividerChar | string | undefined |
titlePadding | number | 1 |
padding | number | 0 |
height | number | 1 |
width | number | "auto" | "auto" |
On horizontal dividers, the rule still uses Ink’s top border on flex-grown segments; dividerChar applies to vertical orientation.