A Base UI (Angular) dropdown is an action menu anchored to a trigger, not a select. Install dropdown-menu, bind the trigger directive to a menu, and leaf items close the popup. Nested menus stay open on hover until you pick a leaf. Use checked or stayOpen for items that must not dismiss.
Install with npx base-ui-cli add dropdown-menu.
To trigger the Basic Dropdown add to the action element [base-dropdown-menu-trigger]="" and the identifier name added to the <base-dropdown-menu></base-dropdown-menu>
<button base-button color="primary" [base-dropdown-menu-trigger]="basic"> Dropdown menu <base-icon name="chevron-down"></base-icon> </button> <base-dropdown-menu #basic> <a base-dropdown-menu-item href="javascript:void(0)">Settings</a> <button base-dropdown-menu-item>User Profile</button> <base-dropdown-menu-item>Logout</base-dropdown-menu-item> </base-dropdown-menu>
TypeScript
import { Component } from '@angular/core';
// Install: npx base-ui-cli add dropdown-menu
// Paths are relative to aliases.components (default: src/app/components)
import { DropdownMenuItemComponent } from './dropdown-menu/dropdown-menu-item/dropdown-menu-item.component';
import { DropdownMenuComponent } from './dropdown-menu/dropdown-menu.component';
import { DropdownPanel } from './dropdown-menu/dropdown-panel';
@Component({
selector: 'app-dropdown-menu-example',
imports: [
DropdownMenuComponent,
DropdownMenuItemComponent
],
template: `...`
})
export class DropdownMenuExampleComponent {}Install
npx base-ui-cli add dropdown-menu
Add icons to base-dropdown-menu-item. To open a nested menu, put [base-dropdown-menu-trigger] on a menu item with placement="right" (or left) — the parent stays open until you pick a leaf action or click outside.
<button base-button color="primary" [base-dropdown-menu-trigger]="basicIcons">
Dropdown with icons
<base-icon name="chevron-down"></base-icon>
</button>
<base-dropdown-menu #basicIcons>
<a base-dropdown-menu-item href="javascript:void(0)">
<base-icon name="settings" class="mr-4 min-w-5 w-5 h-5 stroke-slate-500"></base-icon>
Settings
</a>
<button base-dropdown-menu-item [base-dropdown-menu-trigger]="submenu" placement="right">
<base-icon name="user" class="mr-4 min-w-5 w-5 h-5 stroke-slate-500"></base-icon>
User Profile
<base-icon name="chevron-right" class="ml-auto min-w-5 w-5 h-5 stroke-slate-500"></base-icon>
</button>
<base-dropdown-menu-item>
<base-icon name="arrow-out" class="mr-4 min-w-5 w-5 h-5 stroke-slate-500"></base-icon>
Logout
</base-dropdown-menu-item>
</base-dropdown-menu>
<base-dropdown-menu #submenu>
<a base-dropdown-menu-item href="javascript:void(0)">Password Update</a>
<button base-dropdown-menu-item type="button">Email Update</button>
</base-dropdown-menu>
TypeScript
import { Component } from '@angular/core';
// Install: npx base-ui-cli add dropdown-menu
// Paths are relative to aliases.components (default: src/app/components)
import { DropdownMenuItemComponent } from './dropdown-menu/dropdown-menu-item/dropdown-menu-item.component';
import { DropdownMenuComponent } from './dropdown-menu/dropdown-menu.component';
import { DropdownPanel } from './dropdown-menu/dropdown-panel';
@Component({
selector: 'app-dropdown-menu-example',
imports: [
DropdownMenuComponent,
DropdownMenuItemComponent
],
template: `...`
})
export class DropdownMenuExampleComponent {}Install
npx base-ui-cli add dropdown-menu
Use placement placement="" to control the position of the dropdown. Supported positions are "start" by default, "end", "left", "right", "top-start" and "top-end"
<button base-button color="primary" [base-dropdown-menu-trigger]="menuPosition" placement="end"> Dropdown end <base-icon name="chevron-down"></base-icon> </button> <base-dropdown-menu #menuPosition> <a base-dropdown-menu-item href="javascript:void(0)">Settings</a> <button base-dropdown-menu-item>User Profile</button> <base-dropdown-menu-item>Logout</base-dropdown-menu-item> </base-dropdown-menu>
TypeScript
import { Component } from '@angular/core';
// Install: npx base-ui-cli add dropdown-menu
// Paths are relative to aliases.components (default: src/app/components)
import { DropdownMenuItemComponent } from './dropdown-menu/dropdown-menu-item/dropdown-menu-item.component';
import { DropdownMenuComponent } from './dropdown-menu/dropdown-menu.component';
import { DropdownPanel } from './dropdown-menu/dropdown-panel';
@Component({
selector: 'app-dropdown-menu-example',
imports: [
DropdownMenuComponent,
DropdownMenuItemComponent
],
template: `...`
})
export class DropdownMenuExampleComponent {}Install
npx base-ui-cli add dropdown-menu
Run the following command to add this component to your project:
npx base-ui-cli add dropdown-menu
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Base UI MCP server.
npx -y base-ui-ng-mcp
Base UI provides standalone components. Import the exact elements you want to use into your component.
// Install: npx base-ui-cli add dropdown-menu
// Paths are relative to aliases.components (default: src/app/components)
import { DropdownMenuItemComponent } from './dropdown-menu/dropdown-menu-item/dropdown-menu-item.component';
import { DropdownMenuComponent } from './dropdown-menu/dropdown-menu.component';
import { DropdownPanel } from './dropdown-menu/dropdown-panel';
@Component({
selector: 'app-your-component',
imports: [
DropdownMenuComponent,
DropdownMenuItemComponent
],
template: `...`
})
export class YourComponent {} API for dropdown-menu — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
DropdownPanel | templateRef | Signal<TemplateRef<T>> | — | — |
DropdownPanel | closed | OutputEmitterRef<void> | — | — |
base-dropdown-menu | size | string | — | Optional custom width size for the dropdown container. |
base-dropdown-menu | (closed) | void | — | Event emitted when the menu has fully closed. |
base-dropdown-menu-item | class | string | '' | Extra host classes merged via `cn()`. |
base-dropdown-menu-item | checked | boolean | undefined | undefined | When set, the item is a checkbox (`menuitemcheckbox`) and the menu stays open after click. Two-way bind to toggle. |
base-dropdown-menu-item | stayOpen | boolean | false | Keep the dropdown open after this item is clicked (e.g. a custom toggle). Implied when is bound. |
Content