BaseMenu
BaseMenu serves as a building block for the library's menu components. Library consumers may use it if they have requirements not fulfilled by the branded option, AisMenu. The BaseMenu component wraps these other, related components: BaseMenuItem, BaseMenuGroup and BaseMenuDivider
Props
The following props are exposed to allow you to define and style your menu to fit your needs:
Menu Button
label
the text that should be displayed on the menu buttonbuttonClass
is for adding classes to the menu button containericon
is for designating an icon to appear on the left side of the menu buttoniconClass
is for adding classes to the icon on the left side of the menu buttonarrowIcon
is for designating which arrow icon to appear on the right side of the menu buttonarrowClass
is for adding classes to the arrow icon on the right side of the menu button
Menu Items
This is the menu dropdown container, which contains one or more Menu Items
itemsClass
is for adding classes to the menu items containeritems
the Array of menu items that should be displayed in the dropdown menu container. Menu items can also be passed in via the default slot using the BaseMenuItem component
Menu Item
itemClass
is for adding classes to each of the menu itemsactive-class
for styling the menu items, including nested menu buttons, when hovering.itemIconClass
is for adding classes to the icon on the left side of each menu item
Alignment & Positioning
right
whentrue
this right-aligns the dropdown menu container with the right side of the menu button.dropup
whentrue
the dropdown menu container appears above the menu buttondropright
whentrue
the dropdown menu container appears to the right of the menu buttondropleft
whentrue
the dropdown menu container appears to the left of the menu button
Rendering
The following props allow for flexibility around what element each piece of the menu component is rendered as:
as
this indicates what element the menu wrapper should be rendered as. The default istemplate
buttonAs
this indicates what element the menu button should be rendered as. The default isdiv
itemsAs
this indicates what element the dropdown menu container should be rendered as. The default isdiv
itemAs
this indicates what element each menu item should be rendered as. The default istemplate