Divider for sections, rows, menus, and compact controls.
npx shadcn@latest add @iconiq/r-separator"use client";
import { Separator } from "@/components/ui/r-separator";
export function SeparatorPreview() {
return (
<div className="w-full max-w-md space-y-4 px-4">
<div className="rounded-lg border border-dashed border-border/70 p-4 text-muted-foreground text-sm">
Section above
</div>
<Separator/>
<div className="rounded-lg border border-dashed border-border/70 p-4 text-muted-foreground text-sm">
Section below
</div>
</div>
);
}orientationControls whether the divider spans across the inline axis or separates items inside a fixed-height row.
Type "horizontal" | "vertical"·Default "horizontal"
variantChooses the visual treatment. The default line variant renders a solid rule, dashed repeats short strokes, and dotted uses native dotted border rendering.
Type "line" | "dashed" | "dotted"·Default "line"
toneMaps the divider color to border, muted, brand, or destructive tokens without overriding className.
Type "default" | "muted" | "brand" | "destructive"·Default "default"
spacingAdds orientation-aware margin around the divider for section gutters. Use inset instead for compact menu dividers.
Type "none" | "sm" | "md" | "lg"·Default "none"
insetApplies the compact negative-margin treatment used between menu or list groups.
Type boolean·Default false
decorativeRemoves the separator from the accessibility tree when true. Set it to false only when the divider communicates structure that needs to be announced.
Type boolean·Default true
classNameMerged onto the primitive root so local width, height, margin, color, or placement can be adjusted without changing the component file.
Type string
childrenCaption rendered between the two separators.
Type ReactNode
variantVariant applied to both flanking separators.
Type "line" | "dashed" | "dotted"·Default "line"
toneTone applied to both flanking separators.
Type "default" | "muted" | "brand" | "destructive"·Default "default"
labelClassNameClasses merged onto the caption span.
Type string
separatorClassNameClasses merged onto both flanking separators.
Type string
classNameClasses merged onto the outer flex container.
Type string
The component defaults to decorative presentation, but both primitive versions can opt into separator semantics.
Built on the Radix Separator primitive. Pass decorative={false} when the divider should be announced by assistive technology.
Pass decorative=false when the divider is meaningful enough to be announced by assistive technology.
Additional primitive props and data attributes are forwarded to the root element for composition with layout or menu surfaces.
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: @radix-ui/react-separator.
Installs a Radix separator with the same orientation, decorative, tone, spacing, inset, variant, and SeparatorLabel API as the Base UI version.
Vertical separators stretch with self-stretch inside flex rows and keep a min-h-4 fallback when height is not set.
The generated registry file is /r/r-separator.json.
Contact
Additionally, if you find any bug or issue, feel free to raise an issue.