Code
Props
children
-HTML tags -Custom Components (MenuOption, MenuHeader and MenuDivider)
✅
className
string
❌
search
boolean
❌
selectedItem
string
❌
checkSelectedItems
boolean
❌
removeSelectedItems
boolean
❌
show
boolean
❌
noContentMessage
string
❌
noResultMessage
string
❌
onChange
function
❌
removeSelectedItem
Once an item has been clicked and selected, it will be removed from the list.
checkSelectedItem
Once an item has been clicked and selected, it will show a darker background as a visual indicator.
Children
To generate the structure required for the menu, the developer is able to insert the following components as children elements:
MenuOption
children
string
✅
description
string
❌
icon
boolean
❌
avatar
Object {
username?: string, profilePic?: string
}
❌
avatarStatus
'None' | 'Online' | 'Busy' | 'Away' | 'Ringing" | 'OnCall' | 'OnExternalCall' | 'Recovery' | 'Offline'
❌
value
string
❌
disabled
boolean
❌
onClick
event function
❌
At using the MenuOption
inside a Menu
component, the onClick
is automatically attached and linked with the onChange
event of the Menu
component, so adding it is not necessary and also won't work, because the onClick
will be replaced by the default onChange
event in Menu
component.
MenuHeader
children
string
✅
MenuDivider
It has no props or any configuration.
Example:
onChange
At clicking one the options inside the Menu component, automatically the onChange function event is going to be triggered, allowing developer to execute a custom function that is going to receive as a default param the value of the selected item.
Components Dependency
For this component elaboration there were used the following internal components:
Menu Header
Menu Divider
Live Demo
For detailed code usage documentation, see the Storybooks for each framework below.
React
Last updated