2024-06-07 20:17:03 +03:00
|
|
|
import clsx from 'clsx';
|
|
|
|
|
2025-02-20 20:22:05 +03:00
|
|
|
import { type Styling } from '../props';
|
2024-06-07 20:17:03 +03:00
|
|
|
|
2025-02-20 20:22:05 +03:00
|
|
|
interface DividerProps extends Styling {
|
2024-09-12 16:41:48 +03:00
|
|
|
/** Indicates whether the divider is vertical. */
|
2024-06-07 20:17:03 +03:00
|
|
|
vertical?: boolean;
|
2024-09-12 16:41:48 +03:00
|
|
|
|
|
|
|
/** Margins to apply to the divider `classNames`. */
|
2024-06-07 20:17:03 +03:00
|
|
|
margins?: string;
|
|
|
|
}
|
|
|
|
|
2024-09-12 16:41:48 +03:00
|
|
|
/**
|
2024-10-30 21:35:43 +03:00
|
|
|
* Horizontal or vertical divider with customizable margins and styling.
|
2024-09-12 16:41:48 +03:00
|
|
|
*/
|
2025-02-07 10:53:49 +03:00
|
|
|
export function Divider({ vertical, margins = 'mx-2', className, ...restProps }: DividerProps) {
|
2024-06-07 20:17:03 +03:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className={clsx(
|
2025-03-13 01:14:47 +03:00
|
|
|
vertical ? 'border-x' : 'border-y', //
|
|
|
|
margins,
|
|
|
|
className
|
2024-06-07 20:17:03 +03:00
|
|
|
)}
|
|
|
|
{...restProps}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|