Horizontal
"use client";
import { Separator } from "@/components/ui/separator";
export function Demo() {
return (
<div className="w-full space-y-5">
<p>Horizontal</p>
<Separator />
<div className="flex h-8 items-center gap-4">
<span>Left</span>
<Separator orientation="vertical" />
<span>Right</span>
</div>
</div>
);
}
pnpm dlx shadcn@latest add https://ascii-cn.kdawg.dev/r/separator.jsonimport { Separator } from "@/components/ui/separator""use client";
import { Separator } from "@/components/ui/separator";
export function Demo() {
return (
<div className="w-full space-y-5">
<p>Horizontal</p>
<Separator />
<div className="flex h-8 items-center gap-4">
<span>Left</span>
<Separator orientation="vertical" />
<span>Right</span>
</div>
</div>
);
}
Edit the component's Tailwind classes directly. The component keeps the shadcn composition API with square geometry and the ASCII color palette.
"use client";
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
import { cn } from "@/lib/utils";
function Separator({
className,
orientation = "horizontal",
...props
}: SeparatorPrimitive.Props) {
return (
<SeparatorPrimitive
data-slot="separator"
orientation={orientation}
className={cn(
"shrink-0 bg-[#64717c] data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",
className,
)}
{...props}
/>
);
}
export { Separator };