Menu

Component to render dropdown menu

Use Menu.Item and Menu.Divider components to render the drop down content

If verticalPlacement or horizontalPlacement is not provided, it would be computed based on the position of trigger and menu content.

Usage

The Menu component can be imported using

import { Menu } from '@tail-kit/tail-kit'
NameDescriptionDefault Value
trigger
trigger component to open menu
Element
--
children
menu content, can contain both items and dividers
ReactNode
--
portalParent
parent of the portal container rendering the menu
HTMLElement | undefined
typeof window !== 'undefined' ? document.body : undefined
verticalPlacement
vertical placement of the menu item, it could be either `top` (render the menu at top of the trigger) or `bottom` (render menu at bottom)
"top" | "bottom" | undefined
bottom
horizontalPlacement
horizontal placement of the menu item, it could be either `left` (the left position of menu and trigger co-incide) or `right` (the right position of the menu and trigger co-incide)
"left" | "right" | undefined
left
NameDescriptionDefault Value
label
menu item text
string
--
icon
menu item icon
Element | undefined
--
onClick
function to be called on menu item click
((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined
--
className
additional class
string | undefined
--
style
additional styles
CSSProperties | undefined
--
NameDescriptionDefault Value
className
additional classes for divider
string | undefined
--
style
additional styles
CSSProperties | undefined
--