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"
<Separator />

RTL Support

Set the direction once with DirectionProvider (or <html dir="rtl">) and the separator follows it. No dir prop or rtl: classes needed.

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 -> <html dir>).
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