API REFERENCE · NAVIGATION
<dj-toolbar>
A horizontal action bar with role="toolbar".
npm install @dojo-ng/toolbar
import "@dojo-ng/toolbar";
Layout
- The
leadingslot holds a logo or a menu or back button. - The default slot holds the title or other content.
- The
actionsslot holds the primary action buttons, aligned to the end. stickypins the bar to the top.
Overflow menu
- Set the
overflowproperty to a list of options to put secondary actions in a menu. A⋮button opens them in a popup<dj-list>. - Choosing one emits
dj-actionwith its value. - The menu closes when an item is chosen, on Escape, on a click outside, and when focus leaves it.
Not built
- Moving slotted actions into the menu automatically when space runs out. For now your app decides which actions are primary and which go in
overflow.
Need one of these? Make a request on Discord or add an issue (work item) on Heptapod.
Properties
| Property | Attribute | Type | Default |
|---|---|---|---|
labelAccessible name for the toolbar (sets aria-label on the bar). |
label |
string |
None |
sticky |
sticky reflected |
boolean |
false |
overflowSecondary actions rendered behind the overflow (⋮) button. |
Property only | ListOption[] |
[] |
overflowPosition |
overflow-position reflected |
"above""below""left""right" |
"below" |
Events
| Event | Description |
|---|---|
dj-action | detail: { value } |
Slots
| Slot | Description |
|---|---|
leading | a logo, or a menu or back button. |
| Default slot | the title or other content. |
actions | the primary action buttons, aligned to the end. |
CSS parts
Style these with dj-toolbar::part(name).
barleadingtitleactionsoverflow
Types
The types that the properties above use, as they are declared in the source.
ListOption from @dojo-ng/list
export interface ListOption { value: string; label: string; disabled?: boolean; divider?: boolean; }