AisMenu
The AisMenu is our branded menu component. It was built using our BaseMenu component. The contents of the menu are built using related subcomponents.
Related Subcomponents
AisMenuItem
Each item in the menu.
Props
labelthe text for the menu itemhrefthe url for the menu item when clickedtothe destination for the menu item when using vue-router's RouterLink or Nuxt's NuxtLinkiconthe icon to be displayed on the left side of the menu item. Theiconprop accepts either an object imported from the FontAwesome icon packs, or a string specifying one of the preloaded, core icons
** Note: If no href or to value is provided, the menu item will be plain text and will emit a click event for you to hook into
AisMenuGroup
Allows you to group some menu items together, with a group header. The default slot can be used to list the AisMenuItems in the group.
Props
labelthe text of the group headeritemsthe Array of menu items in the group. This is an alternative to using the default slotheaderAsallows you to render the group header as a different element. The default element isheaderheaderClassallows you to add classes to your group header element
AisMenuDivider
Use the AisDivider component for adding a divider to a menu. When using the items prop for generating your menu, just add an item with type: 'divider'. The divider color is set to bg-ui-gray-100
Example Usages
The menu can be built using the default slot or by using the items prop.
Using Default Slot
To build the menu using the default slot, just pass any combination of AisMenuItem, AisMenuGroup, or AisMenuDivider components into the default slot of the AisMenu component
Using 'Items' Prop
The items prop allows you to define your menu structure in a JavaScript Array instead of using the default slot. In the background the AisMenu component will iterate through your array of items and define the menu contents using the menu subcomponents.
Button Props
labelprop sets the text of the menu buttonbuttonClassprop is for adding classes to the menu buttoniconprop is for specifying the icon to be displayed on the left side of the menu button. It accepts either an object imported from the FontAwesome icon packs, or a string specifying one of the preloaded, core icons
Alignment Prop
The menu you can align on the left or right side of the menu button. The default is for the menu to align with the left side. Use the right prop to have the menu align with the right side of the menu button. This prop is a boolean prop, so it does not require a value. The buttons are styled here to make it easier to see the effect.
Positioning Props
The menu can drop in any direction. The default drop position for the menu is down. Other options are exposed via the following props:
dropupto drop the menu above the menu buttondroprightto drop the menu to the right of the menu buttondropleftto drop the menu to the left of the menu button These props are all Boolean props, so they do not require a value