Separator
A horizontal or vertical rule that divides menus, toolbars, and lists — drawn in the same solid border color as neobrutalist frames.
import { Separator } from "@/components/ui/separator"
export function SeparatorDemo() {The separator draws a thin horizontal or vertical rule between blocks of content. Built on the Base UI Separator component and kept deliberately minimal: a single line in the theme's border color — the same solid stroke that outlines every neobrutalist frame.
Reach for it when:
- Menu and toolbar sections — split groups of actions in dropdowns, sidebars, and command bars.
- Stacked lists — divide rows in settings pages, feeds, and notification panels.
- Inline metadata — vertical rules between stats like views, stars, and last-updated dates.
Installation#
pnpm dlx shadcn@latest add https://neobrutalism.com/r/base/separator.jsonnpx shadcn@latest add https://neobrutalism.com/r/base/separator.jsonyarn dlx shadcn@latest add https://neobrutalism.com/r/base/separator.jsonbunx --bun shadcn@latest add https://neobrutalism.com/r/base/separator.json
Install the following dependencies:
pnpm add @base-ui/reactnpm install @base-ui/reactyarn add @base-ui/reactbun add @base-ui/react
Copy and paste the following code into your project.
"use client"
import * as React from "react"
import { Separator as SeparatorPrimitive } from "radix-ui"
import { cn } from "@/lib/utils"
function Separator({
className,
orientation = "horizontal",
decorative = true,
...props
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
return (
<SeparatorPrimitive.Root
data-slot="separator"
decorative={decorative}
orientation={orientation}
className={cn(
"shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
className
)}
{...props}
/>
)
}
export { Separator }
Update the import paths to match your project setup.
Usage#
import { Separator } from "@/components/ui/separator"<Separator />Examples#
Vertical#
Use orientation="vertical" for a vertical separator.
import { Separator } from "@/components/ui/separator"
export function SeparatorVertical() {Menu#
Vertical separators between menu items with descriptions.
import { Separator } from "@/components/ui/separator"
export function SeparatorMenu() {List#
Horizontal separators between list items.
import { Separator } from "@/components/ui/separator"
export function SeparatorList() {RTL#
To enable RTL support in Neobrutalism.com, see the RTL configuration guide.
"use client"
import * as React from "react"Accessibility#
Base UI's Separator always renders role="separator", with aria-orientation reflecting the orientation prop, so screen readers announce it as a semantic divider. For rules that are purely decorative — between inline stats, say — add aria-hidden="true" (or use a plain styled <div>) so assistive tech doesn't announce dividers that carry no meaning. Note this differs from the Radix variant, which is decorative (role="none") by default.
API Reference#
See the Base UI Separator documentation.