Type Alias BaseSlot
Type Alias
Type Signature
type BaseSlot =
| SlotConfigurationCallback<{ id: string }>
| {
body?: SlotConfigurationCallback<{ id: string }>;
footer?: SlotConfigurationCallback<{ id: string }>;
header?: SlotConfigurationCallback<{ id: string }>;
}
| 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 }),
}
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 callsrender(params)to obtain a DOM node. Returnnullto hide the slot.Object (sub-slot customization):
{ header?, body?, footer? }Each region is an optionalSlotConfigurationCallback. The default UI renders for any region you omit.