Nutrient Web SDK
    Preparing search index...

    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).

    Custom annotation actions with a delete button:

    NutrientViewer.load({
    ui: {
    annotations: {
    actions: (instance, id) => ({
    render: () => {
    const bar = document.createElement("div");
    const deleteBtn = document.createElement("button");
    deleteBtn.textContent = "Delete";
    deleteBtn.onclick = async () => {
    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: (instance, id) => ({ render: () => null }),
    },
    },
    });
    type AnnotationSlots = {
        actions?: BaseSlot;
        deleteConfirm?: BaseSlot;
        link?: BaseSlot;
        note?: BaseSlot;
        status?: BaseSlot;
        textMarkupInline?: BaseSlot;
    }
    Index

    Properties

    actions?: BaseSlot

    Customize or hide the actions for selected annotations.

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

    deleteConfirm?: BaseSlot

    Customize or hide the delete annotation confirmation. Return null from render to skip the confirmation entirely.

    link?: BaseSlot

    Customize or hide the link annotation editor (shown when interacting with a link annotation).

    note?: BaseSlot

    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?: BaseSlot

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

    textMarkupInline?: BaseSlot

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