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.

AisMenuItem

Each item in the menu.

Props

  • label the text for the menu item
  • href the url for the menu item when clicked
  • to the destination for the menu item when using vue-router's RouterLink or Nuxt's NuxtLink
  • icon the icon to be displayed on the left side of the menu item. The icon prop 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

  • label the text of the group header
  • items the Array of menu items in the group. This is an alternative to using the default slot
  • headerAs allows you to render the group header as a different element. The default element is header
  • headerClass allows 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

  • label prop sets the text of the menu button
  • buttonClass prop is for adding classes to the menu button
  • icon prop 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:

  • dropup to drop the menu above the menu button
  • dropright to drop the menu to the right of the menu button
  • dropleft to drop the menu to the left of the menu button These props are all Boolean props, so they do not require a value

Nested Menus