Separator

An ASCII-styled shadcn separator you can install and customize.

Horizontal

LeftRight
"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>
  );
}

Installation

pnpm dlx shadcn@latest add https://ascii-cn.kdawg.dev/r/separator.json

Usage

import { Separator } from "@/components/ui/separator"
example.tsx
"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>
  );
}

Customize

Edit the component's Tailwind classes directly. The component keeps the shadcn composition API with square geometry and the ASCII color palette.

components/ui/separator.tsx
"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 };