Components

Separator

A rule that visually or semantically separates content, drawn by hand: pencil, ledger dashes, a squiggle, dots, a strip of tape, a running stitch or a torn edge of paper. Horizontal or vertical, with an optional centered label.

Install

terminal
npx shadcn@latest add @wobko/separator

First time here? Add the registry to components.json first. How to install

Examples

Seven ways to draw a line

Pencil is the default. The others are for when a divider should say something: ledger dashes, a squiggle, dots, kraft tape, a running stitch, a torn edge.

Or continue with

Children turn the separator into a labeled divider: two rules and a word. Here it splits a sign-in card in two, the way every sign-in card does.

Vertical rules

In a flex row give the separator a height (h-5, or self-stretch). Each vertical rule is its own drawing, so no two are quite alike.

Between the sections of a page

A torn strip where a page changes subject, a stitch where two things are joined, tape for the fold. Real headings and paragraphs stay real; the dividers are decoration.

Demo

Official `separator-demo`: a heading and blurb, a horizontal rule, then three links divided by vertical rules. Both rules are pencil pulls; the vertical ones fill the height of their row.

API reference

Separator

A Radix Separator (asChild is not offered: the element is the drawing's host). Without children it is a 1 px hairline whose drawing is centered on it and spills up to 12 px across it (a hairline host, so layout is exactly shadcn's). Along its length the host clips (`overflow-x: clip` for a horizontal rule, `overflow-y: clip` for a vertical one), so a rule that ends at the window edge never scrolls the page sideways. With children it becomes a labeled divider: two rules around your text.

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Horizontal is h-px w-full; vertical is w-px h-full (give it a height in a flex row, or self-stretch).
decorativebooleantrueAs Radix: decorative rules are role=none and invisible to assistive tech; set false for a real thematic break (role=separator).
variant"pencil" | "dashed" | "wavy" | "dotted" | "tape" | "stitched" | "torn""pencil"pencil = a graphite line drawn against a ruler; dashed = ledger dashes; wavy = a felt-tip squiggle; dotted = ink dots; tape = a strip of kraft tape stuck across; stitched = a running stitch in marker thread; torn = a strip of paper torn along both edges. Calm density draws tape, stitched and torn as the pencil rule.
childrenReactNode-Puts a label in the middle ("or", "continue with"): two rules of the same variant either side, the text in the hand font. The label is real text, read by screen readers when the separator is decorative.
seedstring | number-Pins the hand: the same seed always draws the same rule. Default: derived from useId().

Accessibility

  • Decorative by default (role=none), like shadcn: use decorative={false} only for a real thematic break, and give a labeled non-decorative separator an aria-label, since children of role=separator are presentational.
  • A vertical separator that is not decorative gets aria-orientation=vertical from Radix.
  • The drawing is aria-hidden and pointer-events: none. Until it exists, and in Windows high contrast, the rule is a plain 1 px line.
  • Tape, stitched and torn are decoration; nothing about the meaning of a divider ever depends on them.

Source

The files the CLI copies into your project.

Loading the source