Nutrient Web SDK
    Preparing search index...

    Type Alias SlotConfigurationCallback<Params>

    SlotConfigurationCallback: (
        instance: NutrientViewer.Instance | null,
        id: string,
    ) => SlotConfiguration<Params>

    A callback function that returns a slot configuration. This provides a standard way to customize various slots.

    The SDK internally calls this function once as it prepares to render the associated component.

    You can think of it as an initialization phase for the slot. It receives two parameters: instance and id.

    • instance is the instance of Nutrient Web SDK, and you may make full use of the SDK APIs available on it.
    • id is a unique identifier for the specific component being rendered into the slot. A component, such as comment thread, can have multiple instances, and the id helps to differentiate between them.

    Type Parameters

    • Params

    Type Declaration

    Customizing the comment thread slot with a callback function follows this pattern:

    NutrientViewer.load({
    // ... Your configuration.
    ui: {
    commentThread: (instance, id) => {
    return {
    render: (params) => {
    const div = document.createElement("div");

    // Return a DOM Node.
    return div;
    },
    };
    },
    },
    });