Dropdown
Bootstrap dropdown: compact menus for sort, filters, and actions. Markup below; when to use which trigger → Rules.
Sort menu
- Trigger: current label +
bi-arrow-down-up;btn-ghost(Sqrl custom — or link-style),data-bs-toggle="dropdown", nodropdown-toggle. - Menu:
dropdown-menu→button.dropdown-item; selection =active+aria-current="true".
Sort menu
html
<div class="dropdown">
<button
type="button"
class="btn btn-ghost align-baseline fw-normal text-body"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<i class="bi bi-arrow-down-up me-1" aria-hidden="true"></i>
Name (A-Z)
</button>
<div class="dropdown-menu">
<button type="button" class="dropdown-item active" aria-current="true">
Name (A-Z)
</button>
<button type="button" class="dropdown-item">Name (Z-A)</button>
<button type="button" class="dropdown-item">
Quote potential (high-low)
</button>
<button type="button" class="dropdown-item">
Quote potential (low-high)
</button>
</div>
</div>Docs static block: dropdown-menu show position-static d-block (omit in product).
Button trigger
- Trigger: contextual
btn-*+dropdown-toggle+data-bs-toggle="dropdown". - Same
dropdown-menu/dropdown-itempattern; labels in the menu are plain text rows, not nestedbtn-*buttons.
Primary button trigger
html
<div class="dropdown">
<button
type="button"
class="btn btn-success dropdown-toggle"
data-bs-toggle="dropdown"
aria-expanded="false"
>
Success
</button>
<div class="dropdown-menu">
<button type="button" class="dropdown-item active" aria-current="true">
Success
</button>
<button type="button" class="dropdown-item">Warning</button>
<button type="button" class="dropdown-item">Danger</button>
</div>
</div>Rules
When to use
- Dropdown: user picks one option from a short list (sort, filter, status, overflow actions).
- Not a popover (explanation/tooltip-style content) or a modal (multi-step or blocking task).
- Look and spacing live in
theme.scss— implement with Bootstrap classes only; do not re-specify colours or sizes in app CSS.
Behaviour
- Close on selection (Bootstrap default). For sort-style triggers, update the trigger label to match the new
activeitem. - One
activerow at a time for single-select menus.
Sort-style trigger
- Toolbar/table sort, view, or filter — shows current value + sort icon.
- No
dropdown-toggleon the trigger (no caret); icon isbi-arrow-down-uponly — Iconography.
Button trigger
- Primary/secondary button that opens a menu — add
dropdown-toggle. - Menu copy describes the action or state (e.g. “Warning”, “Delete”); use
btn-dangeron a footer/header button, not as adropdown-itemstyled like a full button.