Skip to content

Divider

Line separator with horizontal and vertical orientation, default and spaced variants.

Preview

Installation

$pnpm exec dgadd add ui/divider
[Installs to]src/components/ui/divider[Item]ui/divider

dgadd is not public on npm yet. Until the first release, pack @diffgazer/add from the repository and install that tarball into this app, which is what puts dgadd on pnpm exec.

UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS once packages are available.

Usage

tsx
import { Divider } from "@/components/ui/divider";export default function DividerDefault() {  return (    <div className="w-full space-y-4">      <p className="text-sm text-muted-foreground">Content above</p>      <Divider />      <p className="text-sm text-muted-foreground">Content below</p>    </div>  );}

Examples

Variants

Preview

Custom Label

Preview

Vertical (plain and spaced)

Preview

Semantic (non-decorative)

Preview

API Reference

Divider

NameTypeDefaultDescription
variant"default" | "spaced""default"Visual style: a single rule or a centered label between two rules.
orientation"horizontal" | "vertical""horizontal"Layout axis. Vertical requires the parent to define a height.
decorativetrue | falsetrueRenders with role="none" and aria-hidden when true. Set to false for meaningful section boundaries; semantic separators require an explicit aria-label.
aria-labelstringAccessible name required for semantic separators. Visible children do not provide the separator name.
childrenReactNodeOptional label text rendered between the rules. Only shown when variant="spaced".

Accessibility

Notes

Spaced Variant

The spaced variant renders a centered label between two rules with margin. Pass children to customize the label; defaults to ✦ when no children are provided. The label renders at full muted-foreground contrast (only the rules are dimmed) and is uppercase and tracked so divider labels share the SectionHeader vocabulary. The default variant is a simple line.

Vertical Orientation

Set orientation="vertical" to render a vertical separator. Works with both default and spaced variants. The parent must define a height for the divider to fill.

Decorative vs Semantic

By default, decorative is true — the divider renders with role="none" so screen readers skip it, including a spaced label such as "or", which is presentational reinforcement of a choice the surrounding controls already express. Set decorative={false} when the separator marks a real structural boundary between distinct page sections, and provide an explicit aria-label. Visible children do not name a separator.

Source

Install via CLI: pnpm exec dgadd add ui/divider.

Highlighted source loads after this disclosure opens. Browse the source repository.