Nutrient Web SDK

ReferenceUIBaseSlot

Type Alias BaseSlot

The base type for any slot configuration value.

Every slot in UI.Configuration accepts one of two forms:

  • Function (full replacement): (getInstance, id) => { render, onMount?, onUnmount? } The SDK calls render(params) to obtain a DOM node. Return null to hide the slot.

  • Object (sub-slot customization): { header?, body?, footer? } Each region is an optional SlotConfigurationCallback. The default UI renders for any region you omit.

Type Alias
Type Signature
type BaseSlot =
    | SlotConfigurationCallback<{ id: string }>
    | {
        body?: SlotConfigurationCallback<{ id: string }>;
        footer?: SlotConfigurationCallback<{ id: string }>;
        header?: SlotConfigurationCallback<{ id: string }>;
    }

Example

Full replacement:

ui: {
search: (getInstance, id) => ({
render: () => {
const div = document.createElement("div");
div.textContent = "Custom search";
return div;
},
}),
}

Sub-slot customization:

ui: {
search: {
header: (getInstance, id) => ({
render: () => {
const div = document.createElement("div");
div.textContent = "Custom header above default search";
return div;
},
}),
// body and footer keep their defaults
},
}

Hide a slot:

ui: {
search: (getInstance, id) => ({ render: () => null }),
}