Menus and dropdowns
Last modified by Thiago Krieck on 2026/11/18 14:13
The standard
A dropdown should hide secondary actions or choices behind one trigger, so that the screen only shows the main ones.
- When to use: Should only hold secondary actions. The action users come for should stay visible as a button, since hidden actions are harder to find. See Buttons.
- Menu button or split button: A menu can open from two kinds of trigger, and the choice depends on whether one of the options is the usual one (see the comparison below).
- Trigger: Should be a <button type="button" class="btn btn-default dropdown-toggle"> with a visible label and a caret. An icon-only trigger, such as More actions (⋮), should have a tooltip and an sr-only label, so that every user knows what it opens. In a split button, the caret part should have its own sr-only label, such as Toggle dropdown, since it is a separate button.
- Items: Should have an icon and a verb label, such as Copy or Export, and be grouped under a dropdown-header when there are more than a few. Destructive items, such as Delete, should come last in their group, so that they are not chosen by accident. See Action labels.
- Position: A menu opened near the right edge should use dropdown-menu-right, so that it stays on screen.
- Keyboard: Enter, Space or Down should open the menu, the arrow keys should move between items and Escape should close it and return focus to the trigger, so that menus work without a mouse.
- Mechanism: Should use the Bootstrap dropdown, so that all menus look and behave the same. New dropdown widgets should not be added.
Menu button vs split button
| Menu button | Split button | |
|---|---|---|
| What it looks like | One button with a caret, or an icon such as ⋮ | Two joined buttons: a label, and a separate caret |
| What a click does | Always opens the menu | The label runs the default action at once; only the caret opens the menu |
| When to use | No option is clearly the usual one, so the user has to choose | One option is chosen most of the time, and the others are alternatives to it |
| Example in XWiki | More actions (⋮) in the page content menu | Edit in the page content menu, for advanced users: Edit opens the default editor, the caret lists WYSIWYG, Wiki, Inline form, Objects and Class |
A split button should never be used when its label and its menu do unrelated things, since users expect the caret to offer other ways of doing what the label does.
Reference example: the page content menu. More actions is a right-aligned menu button with a tooltip and a screen reader label; its items are grouped under Manage, Actions and Viewers headers, with Delete last in Manage. For advanced users, Edit is a split button whose caret lists the other editors.

Menu button: More actions

Split button: Edit, for advanced users
Notes
- Menus should be plain lists of links, without role="menu", unless they implement the full menu keyboard model, since menu roles without that model make menus harder to use. See Accessibility.
- The drawer is not a dropdown: it is the main navigation container. See Interface Overview.
More
- Related: Buttons, Action labels, LiveData table, Interface Overview, Accessibility