mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
17 lines
561 B
TypeScript
17 lines
561 B
TypeScript
![]() |
interface DropdownProps {
|
||
|
children: React.ReactNode
|
||
|
stretchLeft?: boolean
|
||
|
widthClass?: string
|
||
|
}
|
||
|
|
||
|
function Dropdown({children, widthClass='w-fit', stretchLeft}: DropdownProps) {
|
||
|
return (
|
||
|
<div className='relative'>
|
||
|
<div className={`absolute ${stretchLeft ? 'right-0': 'left-0'} z-10 flex flex-col items-stretch justify-start p-2 mt-2 text-sm origin-top-right bg-white border border-gray-100 divide-y rounded-md shadow-lg dark:border-gray-500 dark:bg-gray-900 ${widthClass}`}>
|
||
|
{children}
|
||
|
</div>
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export default Dropdown;
|