Portal/rsconcept/frontend/src/components/container/divider.tsx
2025-03-13 01:20:46 +03:00

28 lines
609 B
TypeScript

import clsx from 'clsx';
import { type Styling } from '../props';
interface DividerProps extends Styling {
/** Indicates whether the divider is vertical. */
vertical?: boolean;
/** Margins to apply to the divider `classNames`. */
margins?: string;
}
/**
* Horizontal or vertical divider with customizable margins and styling.
*/
export function Divider({ vertical, margins = 'mx-2', className, ...restProps }: DividerProps) {
return (
<div
className={clsx(
vertical ? 'border-x' : 'border-y', //
margins,
className
)}
{...restProps}
/>
);
}