Usage

Props

NameTypeRequiredDefaultDescription
classNamestringfalse
Additional className
isSelectablefunctionfalse
Deprecated.
(element: any, index?: number, list?: any[]) => boolean
keyHandlerRefobjectfalse
Ref object which will get the key handler listeners
onSelectfunctionfalse
Callback for selecting an item from the menu
({ event: ReactEvent, item: Menu.Item.props.item, group: bool }) => void
item
will be the
item
prop supplied to the
Item
component
group
will be
true
if the clicked item was a group label

keyHandlerRef

Using the keyHandlerRef prop, it is possible to pass in a ref object to Menu which will become the scope for attaching key handlers.

Please note that the ref you are attaching handlers to should exist outside of the Menu's DOM tree

scrollable

NameTypeRequiredDefaultDescription
classNamestringfalse
Additional className
scrollablebooleanfalsetrue
NameTypeRequiredDefaultDescription
classNamestringfalse
Additional className
itemobjectfalse
Value which can be passed around various callback functions. Can be anything!
selectedbooleanfalsefalse
Is the item selected
NameTypeRequiredDefaultDescription
classNamestringfalse
Additional className
clickablebooleanfalsefalse
Can the group item be clicked
NameTypeRequiredDefaultDescription
classNamestringfalse
Additional className
i18nScopestringfalsecore.menu
The i18n key to use for the menu search's configurable strings. Defaults to using the core library's default strings.
NameTypeRequiredDefaultDescription
classNamestringfalse
Additional className
NameTypeRequiredDefaultDescription
classNamestringfalse
Additional className

Complex Example

Note: To internationalize the Menu.Search placeholder text, either use the placeholder prop, or pass the path to the translation key to the i18nScope prop on the Menu.Search. Otherwise, the search placeholder text defaults to 'Search' in English