implement
Separator

Separator

A line between things.

implement

A signal-based UI framework with no compiler.

Docs
Tutorial
REPL
import { Div, H4, P } from "@implementjs/core";
import { Separator } from "@/lib/components/ui/separator";

export default function SeparatorDemo() {
	return Div(
		{ class: "w-full max-w-md" },
		Div(
			{ class: "space-y-1" },
			H4({ class: "text-sm leading-none font-medium" }, "implement"),
			P(
				{ class: "text-sm text-muted-foreground" },
				"A signal-based UI framework with no compiler.",
			),
		),
		Separator({ class: "my-4" }),
		Div(
			{ class: "flex h-5 items-center space-x-4 text-sm" },
			Div("Docs"),
			Separator({ orientation: "vertical" }),
			Div("Tutorial"),
			Separator({ orientation: "vertical" }),
			Div("REPL"),
		),
	);
}

Installation

npx jsrepo add @implementjs/ui/separator

Nothing else comes with it — this one stands alone on @implementjs/core and @implementjs/primitives.

Usage

A 1px line in the border color, running along whichever orientation you pick. decorative defaults to true, which keeps it out of the accessibility tree — a line drawn for the eye should not be announced. Set it to false for a separator that genuinely divides content into sections.

A vertical separator has no height of its own: give it one, or put it in a flex row that stretches.

import { Separator } from "@/lib/components/ui/separator";

Separator();

Div(
	{ class: "flex h-5 items-center gap-4" },
	Span("Docs"),
	Separator({ orientation: "vertical" }),
	Span("Tutorial"),
);

API Reference

Every prop the styling does not consume is forwarded to the Separator primitive, so the tables below are the whole surface — the behavior props and the styling ones together.

Separator

A line between things. Give it a size and color; it handles the semantics. Styled as a 1px line in the border color, running along whichever orientation you pick. Renders a Div; extra props are forwarded onto it.

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"The direction the separator divides content in.
decorativebooleanfalsePurely visual separators render role="none" and are hidden from assistive technology.
Data attributeValue
[data-separator-root]Present
[data-orientation]"horizontal" | "vertical"