Separator
Updated
Separator is a rule between sections: a 2px ink line or a 4px band in a 50% Bayer dither, horizontal or vertical, with an optional label centered on it. Like the charts, it takes your theme's ink and paper, light or dark, and needs no Tailwind.
Example
Or
DocsChartsControls
import "@/components/dithercharts/controls.css"
import { Separator } from "@/components/dithercharts/separator"
<Separator />
<Separator variant="dither" />
<Separator label="Or" />
// Vertical fills the height of its flex row.
<div className="flex h-10 items-center gap-4">
<span>Docs</span>
<Separator orientation="vertical" />
<span>Charts</span>
</div>Install
Controls install with DitherCharts Pro. See Installation to log in, then import controls.css once, e.g. in your root layout.
npx dithercharts add separator
Props
It renders a native element, so every other attribute that element takes passes through.
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | Type "horizontal" | "vertical" | Default "horizontal" | "horizontal" spans the row; "vertical" fills the height of a flex row, e.g. between toolbar buttons. |
| variant | Type "solid" | "dither" | Default "solid" | "solid" is a 2px ink rule; "dither" is a 4px band in a 50% Bayer dither. |
| label | Type ReactNode | Default – | Text centered on the rule, e.g. "Or", in pixel caps. |
| decorative | Type boolean | Default false | Hides it from screen readers when it only decorates. |

