# Divider

Horizontal or vertical divider / rule



<ComponentPreview base="opentui" name="divider-demo" />

Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @termcn/opentui-divider
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource base="opentui" name="divider" title="components/ui/divider.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

Usage [#usage]

```tsx
import { Divider } from "@/components/ui/divider";
```

```tsx
<Divider label="Section" />
```

Examples [#examples]

Vertical rule and label styling [#vertical-rule-and-label-styling]

Use `dividerChar` and `height` for vertical rules; `titlePadding` and `labelColor` adjust the labeled horizontal variant.

<ComponentPreview base="opentui" name="divider-custom" />

API Reference [#api-reference]

Divider [#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.
