Skip to main content

separator

Visually or semantically separates content.

Philosophy

Visual hierarchy needs breathing room. The Separator creates semantic and visual boundaries between content sections. We expose orientation as the only meaningful prop because a divider's job is to divide - its value comes from where you place it, not how you configure it.

Installation


npx @gentleduck/cli add separator

npx @gentleduck/cli add separator

Usage

import { Separator } from "@/components/ui/separator"
import { Separator } from "@/components/ui/separator"
<Separator />
<Separator />

RTL Support

Direction is resolved through the shared primitives direction module. Use a local dir="rtl" override when the component exposes it, or set DirectionProvider at app/root level for global RTL/LTR behavior.

Motion

Use MotionSeparator for a smooth expand-from-center animation powered by motion. Horizontal separators scale along the X axis, vertical ones along Y.

API Reference

Separator

PropTypeDefaultDescription
orientation'horizontal' | 'vertical''horizontal'Controls the orientation of the separator line
dir'ltr' | 'rtl'-Text direction override. Resolved via useDirection (dir prop -> DirectionProvider -> 'ltr').
classNamestring-Additional CSS class names
...propsReact.HTMLProps<HTMLHRElement>-Additional props to spread to the hr element

MotionSeparator

Expands from center with springBouncy transition — scales along X for horizontal, Y for vertical. Renders a div with role="separator" instead of hr. Requires the motion package.

PropTypeDefaultDescription
orientation'horizontal' | 'vertical''horizontal'Controls the orientation and animation axis
dir'ltr' | 'rtl'-Text direction override
classNamestring-Additional CSS class names
...propsReact.HTMLAttributes<HTMLDivElement>-Additional props to spread to the div element