removeComponent UI
¶
removeComponent API is used to remove any custom UI component using it’s unique ID.
Syntax¶
removeComponent(id: String | Number)
Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import INKAPI from './inkapi.js'
INKAPI.ready(async () => {
const UI = INKAPI.ui;
const sidebarId = "myUniqueSidebarId";
const sidebarObject = await UI.create({
type: "Sidebar",
sidebarTitle: "My Personal Sidebar",
icon: "./sample.svg",
id: sidebarId,
});
/*
.
.
.
*/
// Removing Sidebar Component
UI.removeComponent(sidebarId);
});
|
Parameters¶
Name |
Type |
Description |
---|---|---|
id |
|
Id of the custom UI component to be removed. |