Nutrient Web SDK

ReferenceUISidebarUI

Type Alias SidebarUI

Use this to add custom sidebars and customize the sidebar container.

Type Alias
Type Signature
type SidebarUI = { container?: BaseSlot } & Record<
    string,
    SlotConfigurationCallback<{ id: string }>,
>

Example

Adding a custom sidebar myCustomSidebar:

NutrientViewer.load({
// ... Your configuration.
ui: {
sidebar: {
myCustomSidebar: (getInstance, id) => ({
render: (params) => {
const div = document.createElement("div");
div.innerText = "This is my custom sidebar!";
div.style.padding = "10px";
div.style.color = "#ccc";
return div;
},
}),
},
},
});

See Also