kanso/ui
Display

Separator

A hairline that divides content, horizontally or vertically.

LiveRev. 01

Kanso UI

Minimal components you own.

Docs
Components
Themes

Installation

CLI

$ npx shadcn@latest add https://konsa.rohitxyz.me/r/separator.json

Manual

Install the dependencies

npm install radix-ui

Copy the source into your project

components/ui/separator.tsx
"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-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
        className,
      )}
      {...props}
    />
  );
}

export { Separator };

Update the import paths to match your project

The file imports cn from @/lib/utils. See installation.

Usage

import { Separator } from "@/components/ui/separator";
<Separator />
<Separator orientation="vertical" />
Separator