DitherCharts

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

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.

Separator props
PropTypeDefaultDescription
orientationType "horizontal" | "vertical"Default "horizontal""horizontal" spans the row; "vertical" fills the height of a flex row, e.g. between toolbar buttons.
variantType "solid" | "dither"Default "solid""solid" is a 2px ink rule; "dither" is a 4px band in a 50% Bayer dither.
labelType ReactNodeDefault –Text centered on the rule, e.g. "Or", in pixel caps.
decorativeType booleanDefault falseHides it from screen readers when it only decorates.