A dropdown behind an icon, as at the end of a table row. Drop the caret
with no dropdown-toggle class, give the button an
aria-label and align the menu to the end.
<div class="dropdown">
<button type="button" class="btn btn-icon" data-bs-toggle="dropdown" aria-expanded="false"
aria-label="More actions for order #3086"><i class="bi bi-three-dots-vertical"></i></button>
<ul class="dropdown-menu dropdown-menu-end">…</ul>
</div>
Auto-close
data-bs-auto-close decides which clicks close the menu: any
click, clicks inside only, clicks outside only, or none, so it closes
only from its button or Escape.
A menu that opens where you right-click, for actions on a row. From the
keyboard, focus a row and press Shift+F10 or the menu key. It uses
Bootstrap's menu styles without a toggle button.
Trigger
#3086Annabelle FranklinPacking$1,298.00
#3085Cheryl SorensenPaid$236.00
#3084Eleanor FairweatherShipped$2,145.00
Right-click a row, or focus it and press Shift+F10.
Show code
<ul data-basalt-context="#order-menu">
<li tabindex="0">#3086 Annabelle Franklin $1,298.00</li>
</ul>
<ul class="dropdown-menu basalt-context-menu" id="order-menu" role="menu" aria-label="Actions for this order">
<li role="none"><button type="button" class="dropdown-item" role="menuitem">Open</button></li>
…
</ul>
<script>
// detail.target is the row that was right-clicked.
menu.addEventListener('basalt:context', (e) => { current = e.detail.target; });
</script>
Headers and dividers
dropdown-header names a group,
dropdown-divider separates groups and
dropdown-item-text holds text that isn't a link.
<li><a class="dropdown-item active" href="#" aria-current="true">US dollar (USD)</a></li>
<li><a class="dropdown-item disabled" aria-disabled="true">Japanese yen (JPY)</a></li>
Rich items
Items with an icon tile, a line of explanation and a key. While the menu
is open, pressing a letter jumps to the item that starts with it, on
every menu on this page.
Items
Open the menu and press O.
Show code
<ul class="dropdown-menu basalt-dd-rich">
<li><button type="button" class="dropdown-item basalt-dd-item">
<span class="basalt-dd-item-icon basalt-dd-item-icon-1"><i class="bi bi-box-seam"></i></span>
<span class="basalt-dd-item-text">
<span class="basalt-dd-item-title">Product</span>
<span class="basalt-dd-item-sub">Add a piece, accessory or extra</span>
</span>
<kbd class="basalt-dd-item-kbd">P</kbd>
</button></li>
</ul>
<!-- --1 to --4 take the first four chart colors -->
Nested submenu
An item that opens a second menu to the side, which Bootstrap 5 dropped.
Hover or click it, or press the right arrow; the left arrow and Escape
close it again and put you back where you were.
A destructive item that asks inside the menu instead of opening a
dialog. The first choice turns it into the question and keeps the menu
open; the second does it. Leaving the item or closing the menu cancels.
Open up with dropup, sideways with dropend and
dropstart, or centered under the button with
dropdown-center. Bootstrap flips a menu that would leave
the screen.
dropdown-menu-end lines the menu up with the right edge of
its button, dropdown-menu-lg-end does that only from the
large breakpoint, and data-bs-offset moves it away from the
button.
Checkboxes in a menu that stays open while you choose. A select-all box
shows when only some are checked, the button counts the choices and each
one shows as a chip you can remove.
A dropdown that holds a small form, with a header, a footer and a live
count on the apply button. Nothing changes until you apply; Cancel or
Escape puts the choices back as they were.
A wide menu laid out in columns, with a highlight tile beside them. The
links are ordinary dropdown items, so the arrow keys and typing a letter
still work; on a phone the columns stack.
A menu with a search box on top, for lists too long to scan. The arrow
keys go from the box into the list and back; picking someone updates the
button and closes the menu.
A search box over grouped results: pages, records and actions in one
list. Typing narrows it and marks the matches, the arrow keys move
through what is left and Enter opens it. Use it inline, or as a dropdown
on a button or the / key.
Search
As a dropdown
Pages
OrdersEvery order, newest first
ProductsClothing, accessories and extras
CustomersPeople who have ordered
Actions
New orderTake an order for a customer
Export ordersDownload as CSV
Nothing matches "".
↑↓ moveEnter openEsc clear
Try typing
Nothing opened yet.
Pages
OrdersEvery order, newest firstG O
ProductsClothing, accessories and extras in the storeG P
CustomersPeople who have ordered from the storeG C
SubscriptionsMonthly extras and their renewal dates