Optionalbody?: SlotConfigurationCallback<{ id: string }>Use this to customize the body (main content) of the comment.
Replace the body of each comment by customizing the body slot:
NutrientViewer.load({
// ... Your configuration.
ui: {
commentThread: {
comment: {
body: () => {
return {
render: () => {
const div = document.createElement("div");
div.style.backgroundColor = "lightgreen";
div.style.padding = "5px";
div.innerText = "This is a custom body for the comment.";
return div;
},
};
},
},
},
},
});
Optionalfooter?: SlotConfigurationCallback<{ id: string }>Use this to render a custom UI in the footer (bottom area) of each comment
Add a custom footer to each comment by customizing the footer slot:
NutrientViewer.load({
// ... Your configuration.
ui: {
commentThread: {
comment: {
footer: () => {
return {
render: () => {
const div = document.createElement("div");
div.style.backgroundColor = "lightgreen";
div.style.padding = "5px";
div.innerText = "This is a custom footer for the comment.";
return div;
},
};
},
},
},
},
});
Optionalheader?: SlotConfigurationCallback<{ id: string }>Use this to render a custom UI in the header (top area) of each comment.
Add a custom header to each comment by customizing the header slot:
NutrientViewer.load({
// ... Your configuration.
ui: {
commentThread: {
comment: {
header: () => {
return {
render: () => {
const div = document.createElement("div");
div.style.backgroundColor = "lightgreen";
div.style.padding = "5px";
div.innerText = "This is a custom header for the comment.";
return div;
},
};
},
},
},
},
});
Customize the entire comment:
NutrientViewer.load({
// ... Your configuration.
ui: {
commentThread: {
comment: () => {
return {
render: () => {
const div = document.createElement("div");
div.style.backgroundColor = "hotpink";
div.style.padding = "5px";
div.innerText = "This is a custom comment.";
return div;
},
};
},
},
},
});
Customize the header slot within a comment:
NutrientViewer.load({
// ... Your configuration.
ui: {
commentThread: {
comment: {
header: () => {
return {
render: () => {
const div = document.createElement("div");
div.style.backgroundColor = "hotpink";
div.style.padding = "5px";
div.innerText = "This is a custom header for a comment.";
return div;
},
};
},
},
},
},
});
Use this to customize comment or its slots.