Files
cunkebao_v3/Cunkebao/components/ui/separator.tsx

24 lines
592 B
TypeScript
Raw Normal View History

2025-03-29 16:50:39 +08:00
import * as React from "react"
import { cn } from "@/lib/utils"
export interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
orientation?: "horizontal" | "vertical"
}
const Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(
({ className, orientation = "horizontal", ...props }, ref) => (
<div
2025-03-29 16:50:39 +08:00
ref={ref}
className={cn(
"shrink-0 bg-border",
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
className,
2025-03-29 16:50:39 +08:00
)}
{...props}
/>
),
2025-03-29 16:50:39 +08:00
)
Separator.displayName = "Separator"
2025-03-29 16:50:39 +08:00
export { Separator }