Skip to main content

Separator

Horizontal and vertical divider that draws cleanly from center, start, or end on viewport entry, plus an optional LabeledSeparator effect.

Rules draw cleanly on view entry; press Replay to re-trigger.
Motion tokens

Unified springs and scaleDraw transitions across sections.

Registry
Docs
Source

Customize

Speed1

Installation

Add the base divider:

npx shadcn@latest add @kinetic/separator

Add the optional centered label divider effect:

npx shadcn@latest add @kinetic/labeled-separator

Usage

Separator uses scaleDraw triggered by IntersectionObserver so horizontal rules expand smoothly from center, start, or end without causing layout shift. Under SSR, missing IntersectionObserver, or reduced motion preferences, lines render immediately at full scale.

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

interface SectionDividerProps {
  readonly heading: string;
}

export function SectionDivider({ heading }: SectionDividerProps) {
  return (
    <div className="space-y-3">
      <h4 className="text-sm font-medium">{heading}</h4>
      <Separator origin="start" />
      <div className="flex h-5 items-center gap-3 text-xs text-muted-foreground">
        <span>Registry</span>
        <Separator orientation="vertical" origin="center" />
        <span>Docs</span>
      </div>
    </div>
  );
}

Labeled separator

Use LabeledSeparator from @kinetic/labeled-separator when placing "or" or section labels between two symmetrically drawn lines coordinated by a single observer.

import { LabeledSeparator } from "@/components/kinetic/ui/labeled-separator";

interface AuthDividerProps {
  readonly label: string;
}

export function AuthDivider({ label }: AuthDividerProps) {
  return <LabeledSeparator>{label}</LabeledSeparator>;
}

API Reference

Separator

Draws along scaleX or scaleY on view entry with configurable origin, duration, and once behavior.

PropTypeDefaultDescription
orientation / decorative"horizontal" | "vertical" / boolean"horizontal" / trueRule orientation and role='none' vs role='separator' accessibility semantics.
origin / drawOnView / once"start" | "center" | "end" / boolean / boolean"center" / true / trueTransform origin anchor, viewport observer trigger, and single-shot lock.
durationMs / speednumber / number420 / 1Base draw duration and playback speed multiplier.

LabeledSeparator

Separate registry effect (@kinetic/labeled-separator) pairing center label reveal with two symmetrical child Separators under one IntersectionObserver.

PropTypeDefaultDescription
labelClassName / lineClassNamestring / string-Custom utility classes for the centered label span and surrounding lines.
orientation / decorative / speed"horizontal" | "vertical" / boolean / number"horizontal" / true / 1Layout axis, semantic role mode, and draw animation speed.

Notes

Uses the shared scaleDraw helper on viewport intersection and stays immediately visible under reduced motion or when IntersectionObserver is unavailable.