Toolbar Actions
Toolbar actions add buttons to the UmbNav item toolbar that appears when hovering over menu items in the backoffice.
Basic Registration
import { UmbNavExtensionRegistry } from '/App_Plugins/UmbNav/dist/api.js';
UmbNavExtensionRegistry.registerToolbarAction({
alias: 'my-custom-action',
label: 'Star Item',
icon: 'icon-favorite',
onExecute: (item, context) => {
console.log('Action clicked on:', item.name);
}
});Interface Definition
interface UmbNavToolbarAction {
/** Unique identifier for this action */
alias: string;
/** Display label (shown as tooltip) */
label: string;
/** Icon name (UUI icon) */
icon: string;
/** Position: 'start' | 'end' | number */
position?: 'start' | 'end' | number;
/** Visibility check function */
isVisible?: (item: ModelEntryType, config: UmbPropertyEditorConfigProperty[]) => boolean;
/** Handler when clicked */
onExecute: (item: ModelEntryType, context: UmbNavActionContext) => void | Promise<void>;
}Action Context
Examples
Simple Notification
Toggle a Property
Conditional Visibility
Async Operations
Opening a Modal
Position Control
Removing Items
Complex Business Logic
Unregistering Actions
Getting Registered Actions
Available Icons
Best Practices
Last updated
Was this helpful?