ConceptPortal-public/rsconcept/frontend/src/components/ui/Overlay.tsx
Ivan c1f50d6f50
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
D: Improve TSDocs for frontend components
2024-11-21 15:09:51 +03:00

36 lines
711 B
TypeScript

import clsx from 'clsx';
import { CProps } from '../props';
interface OverlayProps extends CProps.Styling {
/** Id of the overlay. */
id?: string;
/** Classnames for position of the overlay. */
position?: string;
/** Classname for z-index of the overlay. */
layer?: string;
}
/**
* Displays a transparent overlay over the main content.
*/
function Overlay({
children,
className,
position = 'top-0 right-0',
layer = 'z-pop',
...restProps
}: React.PropsWithChildren<OverlayProps>) {
return (
<div className='relative'>
<div className={clsx('absolute', className, position, layer)} {...restProps}>
{children}
</div>
</div>
);
}
export default Overlay;