Navigation

Dropdown

Basic


Description

This component is used to create a dropdown menu. It can be triggered by a button or a link with a hover or click event.
The dropdown menu can contain links, dividers, disabled items and submenus.
You can use icons with the icon component, the library will take care of the spacing between the icon and the text and the icon size.


API

Supports global configuration

View the default configuration for this component. Learn more about global configuration.

import { LuiDropdownModule } from '@lqvrent-workspace/lqvrent-ui/dropdown';
<!-- Trigger using a link -->
<a lui-dropdown [luiDropdownMenu]="menu">
  Hover me
</a>
<!-- Or trigger using a button -->
<button type="button" lui-button lui-dropdown [luiDropdownMenu]="menu">
  Hover me
</button>

<!-- Define a menu -->
<lui-dropdown-menu #menu="luiDropdownMenu">
  <ul lui-menu>
    <li lui-menu-item>Navigation One</li>
    <li lui-menu-item>Navigation Two</li>
    <li lui-submenu luiTitle="Navigation Three">
      <li lui-menu-item>Submenu Navigation One</li>
      <li lui-menu-item>Submenu Navigation Two</li>
      <li lui-menu-item>Submenu Navigation Three</li>
    </li>
  </ul>
</lui-dropdown-menu>

[lui-dropdown]

directive Standalone
PropertyDescriptionTypeDefault
[luiDropdownMenu]Dropdown menuLuiDropdownMenuComponent-
[luiTrigger]Define whats trigger the dropdown menu'click' | 'hover''hover'
[luiClickHide]Weither it hides the menu on clickbooleantrue
[luiDisabled]Weither the menu is disabledbooleanfalse
[luiVisible]Visibility of the dropdown menu Supports double bindingbooleanfalse
[luiOverlayClass]Classes for the popoverstringdefined in config
[luiPlacement]Placement of the dropdown menu'bottomLeft' | 'bottomCenter' | 'bottomRight' | 'topLeft' | 'topCenter' | 'topRight''bottomCenter'
(luiVisibleChange)Emitted when the visibility is changedEventEmitter<boolean>-

lui-dropdown-menu

component Standalone

Wrap the dropdown menu content to pass it to [lui-dropdown] or LuiContextMenuService. You can export it via Template Syntax luiDropdownMenu.

Every [lui-dropdown] should have independent lui-dropdown-menu.

<!-- Define a menu -->
<lui-dropdown-menu #menu="luiDropdownMenu">
  <ul lui-menu>
    <li lui-menu-item>Navigation One</li>
    <li lui-menu-item>Navigation Two</li>
    <li lui-submenu luiTitle="Navigation Three">
      <li lui-menu-item>Submenu Navigation One</li>
      <li lui-menu-item>Submenu Navigation Two</li>
      <li lui-menu-item>Submenu Navigation Three</li>
    </li>
  </ul>
</lui-dropdown-menu>

LuiContextMenuService

service
MethodDescriptionArgumentsReturn type
createCreate a dropdown menu($event: MouseEvent | { x: number, y: number }, menu: LuiDropdownMenuComponent, popoverClass?: string)EmbeddedViewRef<any>
closeClose the dropdown menu--

More examples

Trigger mode

Click events

An event is emitted when clicking on a menu item, which can be used to trigger any action.

Dividers, disabled and submenu

Placement

Button group

Custom close

With icons and custom style

Context menu

Right click on here

Custom content (non-menu)

Previous
Layout
Next
Menu