Separator
Horizontal and vertical divider that draws cleanly from center, start, or end on viewport entry, plus an optional LabeledSeparator effect.
Unified springs and scaleDraw transitions across sections.
Customize
Installation
Add the base divider:
npx shadcn@latest add @kinetic/separatorAdd the optional centered label divider effect:
npx shadcn@latest add @kinetic/labeled-separatorUsage
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.
| Prop | Type | Default | Description |
|---|---|---|---|
orientation / decorative | "horizontal" | "vertical" / boolean | "horizontal" / true | Rule orientation and role='none' vs role='separator' accessibility semantics. |
origin / drawOnView / once | "start" | "center" | "end" / boolean / boolean | "center" / true / true | Transform origin anchor, viewport observer trigger, and single-shot lock. |
durationMs / speed | number / number | 420 / 1 | Base 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.
| Prop | Type | Default | Description |
|---|---|---|---|
labelClassName / lineClassName | string / string | - | Custom utility classes for the centered label span and surrounding lines. |
orientation / decorative / speed | "horizontal" | "vertical" / boolean / number | "horizontal" / true / 1 | Layout axis, semantic role mode, and draw animation speed. |