# Divider

> Renders a thin line to separate content and create a clear visual hierarchy. Dividers can be used to group related items in lists and layouts.

Source: https://vaneui.com/docs/layout-components/divider

Import: `import { Divider, Card, Col, Row, Stack, Text } from "@vaneui/ui"`

Use Divider between items that share one surface, such as groups of controls or the rows of a card. It renders a `<div>` with `role="separator"` and an `aria-orientation` that follows the `vertical` prop, so assistive technology reads the line as a separator. Inside a [Menu](/docs/overlay-components/menu), a Divider takes its size and spacing from the menu; to split a page into bands with different backgrounds, use [Section](/docs/layout-components/section) instead.

## Basic usage

A horizontal divider.

```tsx demo
<Col>
  <Text>Content above the divider</Text>
  <Divider />
  <Text>Content below the divider</Text>
</Col>
```

## Sizes

Sizes (`xs`, `sm`, `md`, `lg`, `xl`) drive the per-size vertical padding via `--py-unit`. The line itself stays one pixel; pass `padding` to make the surrounding spacing visible.

```tsx demo
<Col lg>
  <div>
    <Text fontSemibold>Divider xs</Text>
    <Divider xs padding />
    <Text>Content after xs divider</Text>
  </div>
  <div>
    <Text fontSemibold>Divider sm</Text>
    <Divider sm padding />
    <Text>Content after sm divider</Text>
  </div>
  <div>
    <Text fontSemibold>Divider md (default)</Text>
    <Divider padding />
    <Text>Content after md divider</Text>
  </div>
  <div>
    <Text fontSemibold>Divider lg</Text>
    <Divider lg padding />
    <Text>Content after lg divider</Text>
  </div>
  <div>
    <Text fontSemibold>Divider xl</Text>
    <Divider xl padding />
    <Text>Content after xl divider</Text>
  </div>
</Col>
```

## Appearances

Dividers use `inheritAppearance` by default. Pass an explicit appearance for a colored line.

```tsx demo
<Col lg>
  <div>
    <Text fontSemibold>Divider primary</Text>
    <Divider primary />
    <Text>Content after primary divider</Text>
  </div>
  <div>
    <Text fontSemibold>Divider accent</Text>
    <Divider accent />
    <Text>Content after accent divider</Text>
  </div>
  <div>
    <Text fontSemibold>Divider secondary</Text>
    <Divider secondary />
    <Text>Content after secondary divider</Text>
  </div>
  <div>
    <Text fontSemibold>Divider tertiary</Text>
    <Divider tertiary />
    <Text>Content after tertiary divider</Text>
  </div>
  <div>
    <Text fontSemibold>Divider success</Text>
    <Divider success />
    <Text>Content after success divider</Text>
  </div>
  <div>
    <Text fontSemibold>Divider danger</Text>
    <Divider danger />
    <Text>Content after danger divider</Text>
  </div>
  <div>
    <Text fontSemibold>Divider warning</Text>
    <Divider warning />
    <Text>Content after warning divider</Text>
  </div>
</Col>
```

## Variants

`filled` paints the line with a translucent light scrim (`--color-divider-filled`), the same for every appearance, so it reads on a filled surface.

```tsx demo
<Row flexWrap>
  <Card primary filled>
    <Text>Above</Text>
    <Divider filled />
    <Text>Below</Text>
  </Card>
  <Card success filled>
    <Text>Above</Text>
    <Divider filled />
    <Text>Below</Text>
  </Card>
</Row>
```

## Vertical divider

Pass `vertical` to render a vertical separator. Useful for inline navigation or toolbars; place it inside a `Row` so it can stretch to the row's height.

```tsx demo
<Row className="h-10">
  <Text>Home</Text>
  <Divider vertical />
  <Text>About</Text>
  <Divider vertical />
  <Text>Contact</Text>
</Row>
```

## Separating list items

Use `Divider` between items in a `Stack` or `Col` to group related rows.

```tsx demo
<Stack>
  <Row justifyBetween>
    <Text fontSemibold>Plan</Text>
    <Text>Pro</Text>
  </Row>
  <Divider />
  <Row justifyBetween>
    <Text fontSemibold>Seats</Text>
    <Text>12</Text>
  </Row>
  <Divider />
  <Row justifyBetween>
    <Text fontSemibold>Renews</Text>
    <Text>May 2026</Text>
  </Row>
</Stack>
```

## Separating content blocks

Dividers also work as section breaks between larger blocks of content.

```tsx demo
<Col lg>
  <div>
    <Text fontSemibold lg>Block 1</Text>
    <Text>The first block introduces the topic and sets context for the sections that follow.</Text>
  </div>
  <Divider />
  <div>
    <Text fontSemibold lg>Block 2</Text>
    <Text>The second block expands on the idea, with the divider providing a clear visual break.</Text>
  </div>
  <Divider />
  <div>
    <Text fontSemibold lg>Block 3</Text>
    <Text>The third block closes out the sequence, demonstrating consistent rhythm throughout.</Text>
  </div>
</Col>
```

## Props

| Prop | Category | Default | Description |
| --- | --- | --- | --- |
| `primary` | Appearance |  | Primary color appearance (gray) |
| `accent` | Appearance |  | Accent color appearance (rose) |
| `secondary` | Appearance |  | Secondary color appearance (gray) |
| `tertiary` | Appearance |  | Tertiary color appearance |
| `success` | Appearance |  | Success color appearance (green) |
| `danger` | Appearance |  | Danger color appearance (red) |
| `warning` | Appearance |  | Warning color appearance (amber) |
| `info` | Appearance |  | Info color appearance (cyan) |
| `inheritAppearance` | Appearance | yes | Inherit appearance from parent — suppresses own data-appearance/data-variant, uses parent's CSS variables |
| `padding` | Padding |  | Enable internal padding |
| `paddingX` | Padding |  | Enable only horizontal padding |
| `paddingY` | Padding |  | Enable only vertical padding |
| `noPadding` | Padding | yes | Disable internal padding |
| `xs` | Size |  | Extra small size |
| `sm` | Size |  | Small size |
| `md` | Size | yes | Medium size (default) |
| `lg` | Size |  | Large size |
| `xl` | Size |  | Extra large size |
| `skeleton` | Skeleton |  | Show the component as a loading placeholder in its own size and shape. On a container, every component inside it becomes a placeholder too |
| `filled` | Variant |  | Filled variant - solid background with contrasting text color |
| `outline` | Variant | yes | Outline variant - transparent background with border and colored text (default) |
| `ghost` | Variant |  | Ghost variant - transparent background, no border, appearance-colored text, tinted hover background |

Layout and utility props (Display, Height, Hide, Items, Justify, Orientation, Overflow, Position, Responsive Sizing, Responsive Width, Show, Transparent, Width) are listed on [Common Props](https://vaneui.com/docs/reference/common-props.md).
