Skip to content
Document Authoring DA  API Docs v1.9.1
npmGitHub

ToolbarActionItemNEW

ToolbarActionItem:

{
type: "action";
}

Action toolbar item - references an action by ID

Use this to add custom actions to the toolbar. The action must be registered via DocAuthEditor.setActions or UIOptions.actions.

import { defaultToolbarConfig } from '@nutrient-sdk/document-authoring';
// First, register a custom action
editor.setActions([
{
id: 'custom.insert-signature',
label: 'Insert Signature',
handler: () => editor.insertTextAtCursor('\n\nBest regards,\nJohn Doe'),
},
]);
// Then add it to the toolbar
editor.setToolbarConfig({
items: [{ type: 'action', id: 'sig-btn', actionId: 'custom.insert-signature' }],
});

type: "action"


id: string

Unique ID for this toolbar item


actionId: string

ID of the action to trigger when this item is clicked