# Divider

A horizontal or vertical dithered rule whose ends fade out, with an optional label in the middle.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. The dithercn agent skill, for building any dither on the engine, is at [/.well-known/agent-skills/dithercn/SKILL.md](/.well-known/agent-skills/dithercn/SKILL.md).

<ComponentPreview src="examples/divider-demo.tsx" controls="dividerControls">
  <DividerDemo />
</ComponentPreview>

## Installation [#installation]

<InstallBlock name="divider" />

## Usage [#usage]

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

export function Section() {
  return (
    <>
      <p>First section</p>
      <Divider />
      <p>Second section</p>
    </>
  );
}
```

The rule is solid in the middle and fades towards each tip in ten steps of dither. `fade` sets how much of each half is spent fading.

## Examples [#examples]

### With a label [#with-a-label]

Pass `label` and the rule splits around it, each half fading away from the text.

<ComponentPreview src="examples/divider-label.tsx" size="lg">
  <DividerLabel />
</ComponentPreview>

### Vertical, between stats [#vertical-between-stats]

A vertical divider fills the height of its container. Here it uses `--foreground` at half strength and 2 pixel cells, so it separates the numbers without competing with them.

<ComponentPreview src="examples/divider-vertical.tsx" size="sm">
  <DividerVertical />
</ComponentPreview>

## Props [#props]

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Which way the rule runs. |
| `label` | `ReactNode` | `–` | Text in the middle of the rule. Horizontal only. |
| `thickness` | `number` | `1` | Thickness in cells. |
| `fade` | `number` | `0.6` | Share of each half that fades out, from 0 to 1. |
| `strength` | `number` | `0.6` | Densest dither level, in the middle of the rule. |
| `color` | `DitherColor` | `"ink"` | Rule colour: a palette name such as "blue", a CSS variable name, or any CSS colour. |
| `fill` | `"gradient" \| "dotted" \| "hatched" \| "solid"` | `"gradient"` | Texture of the rule. Gradient fades through dither levels; the others keep their texture and fade by opacity. |
| `matrix` | `"bayer2" \| "bayer4" \| "bayer8" \| "blue-noise"` | `"bayer4"` | The threshold pattern for the gradient fill. |
| `cell` | `number` | `2` | Size of one dither cell in CSS pixels. |
| `decorative` | `boolean` | `true` | Unlabelled rules only. false gives the rule role="separator" for assistive technology. |

## Notes [#notes]

* By default the rule is decorative, like most visual dividers. Set `decorative={false}` when it separates content that screen reader users should know is split. A labelled divider reads its label as ordinary text.
* The rule is one SVG with no viewBox, so a dither cell is always a whole number of CSS pixels and every step of the fade lines up with its neighbours.
* It has no motion.