> Leaf UI 0.17.3 · Package: @ifhover/leaf-ui · Source: c3221834f84f2f48481a2054026b713456f8e5dc
> Browser documentation: https://ifhover.github.io/leaf-ui/en/components/divider.html

> For AI agents: the complete documentation index is available at https://ifhover.github.io/leaf-ui/en/llms.txt, the full documentation bundle is available at https://ifhover.github.io/leaf-ui/en/llms-full.txt.

# Divider

Separate content, paragraphs or inline information.


## Basic usage

Place `Divider` between content sections; the default divider is horizontal.


Project detailsTeam members

basic.tsx

Copy code

```tsx lineNumbers file="../../../src/examples/en/divider/basic.tsx"
import { Divider, Flex, Text } from '@ifhover/leaf-ui';

export function DividerBasic() {
  return (
    <Flex direction="column" gap="sm">
      <Text>Project details</Text>
      <Divider />
      <Text>Team members</Text>
    </Flex>
  );
}
```

Expand code


## Examples

### Text alignment

Use `children` for a label and `align` for its position. Labels are only rendered on horizontal dividers.


Start

Settings

Center

Settings

End

Settings

alignment.tsx

Copy code

```tsx lineNumbers file="../../../src/examples/en/divider/alignment.tsx"
import { Divider, Flex, Text } from '@ifhover/leaf-ui';

const alignments = [
  { align: 'start', label: 'Start' },
  { align: 'center', label: 'Center' },
  { align: 'end', label: 'End' },
] as const;

export function DividerAlignment() {
  return (
    <Flex direction="column" gap="lg">
      {alignments.map(({ align, label }) => (
        <Flex key={align} direction="column" gap="sm">
          <Text tone="muted">{label}</Text>
          <Divider align={align}>Settings</Divider>
        </Flex>
      ))}
    </Flex>
  );
}
```

Expand code

### Dashed line

Set `dashed` to use a dashed divider.


Solid

Dashed

dashed.tsx

Copy code

```tsx lineNumbers file="../../../src/examples/en/divider/dashed.tsx"
import { Divider, Flex, Text } from '@ifhover/leaf-ui';

export function DividerDashed() {
  return (
    <Flex direction="column" gap="lg">
      <Flex direction="column" gap="sm">
        <Text tone="muted">Solid</Text>
        <Divider />
      </Flex>
      <Flex direction="column" gap="sm">
        <Text tone="muted">Dashed</Text>
        <Divider dashed />
      </Flex>
    </Flex>
  );
}
```

Expand code

### Vertical divider

Use `type="vertical"` between inline content.


ProjectTeam onlyUpdated today

vertical.tsx

Copy code

```tsx lineNumbers file="../../../src/examples/en/divider/vertical.tsx"
import { Divider, Space, Text } from '@ifhover/leaf-ui';

export function DividerVertical() {
  return (
    <Space size={0} split={<Divider type="vertical" />}>
      <Text>Project</Text>
      <Text>Team only</Text>
      <Text>Updated today</Text>
    </Space>
  );
}
```

Expand code


## API

### Divider API

Supports native `div` attributes. String children provide an accessible name automatically; use `aria-label` to name complex labels such as icons.

| Property   | Type                           | Default        | Description                           |
| ---------- | ------------------------------ | -------------- | ------------------------------------- |
| `type`     | `'horizontal' \| 'vertical'`   | `'horizontal'` | Orientation                           |
| `align`    | `'start' \| 'center' \| 'end'` | `'center'`     | Text alignment                        |
| `dashed`   | `boolean`                      | `false`        | Dashed line                           |
| `children` | `ReactNode`                    | —              | Content displayed within the divider. |
