Nutrient Web SDK

ReferenceUIAnnotationSlots

Type Alias AnnotationSlots

Annotation-related slot configuration - UI surfaces for viewing, selecting, and managing annotations.

Slot Trigger Description
actions Annotation selected Action buttons (delete, duplicate, custom) for the selected annotation. Replaces annotationTooltipCallback.
status Hover on locked/read-only annotation Status indicator showing "Locked" or "Read only" flags.
textMarkupInline Text selected (with markup tools) Inline toolbar for creating highlights, underlines, strikeouts.
deleteConfirm Delete annotation triggered Confirmation dialog before deleting an annotation.
link Link annotation interaction Editor for link annotation URL/action.
note Note annotation expanded Popup showing the note's text content (not the canvas icon).
Type Alias

Example

Custom annotation actions with a delete button:

NutrientViewer.load({
ui: {
annotations: {
actions: (getInstance, id) => ({
render: () => {
const bar = document.createElement("div");
const deleteBtn = document.createElement("button");
deleteBtn.textContent = "Delete";
deleteBtn.onclick = async () => {
const instance = getInstance();
const selected = instance?.getSelectedAnnotations();
if (selected?.size) await instance?.delete(selected.first().id);
};
bar.appendChild(deleteBtn);
return bar;
},
}),
},
},
});

Skip the delete confirmation and delete immediately:

NutrientViewer.load({
ui: {
annotations: {
deleteConfirm: { autoResolve: "accept" },
},
},
});

See Also

Properties

actions

Optional

Customize or hide the actions for selected annotations.

Note: This slot replaces customization previously done via annotationTooltipCallback. Use getInstance()?.getSelectedAnnotations() to access the selected annotation(s).

Customize or hide the delete annotation confirmation. Set autoResolve: "accept" to delete immediately without the prompt, or autoResolve: "reject" to always cancel.

note

Optional

Customize or hide the note annotation expanded view.

Note: This controls the popup showing the note's text content - not the note indicator icon on the canvas. The popup's appearance is determined by the PDF reader (per PDF spec ยง12.5.6.4), making it UI that customers may want to customize.

status

Optional

Customize or hide the locked/read-only annotation status indicator (shown when hovering locked or read-only annotations).

Customize or hide the text markup inline toolbar (toolbar shown when text is selected for markup).