PopupModal
Spicetify provides a set of methods to create and control popup modals. This will display a modal on top of the client, which can be used to display information or ask for user input.
namespace PopupModal {
interface Content {
title: string;
content: string | Element;
isLarge?: boolean;
}
function display(content: Content): void;
function hide(): void;
};
Interface
Content
Content
is an object that contains information about the modal needs to be displayed.
Property | Type | Description |
---|---|---|
title | string | Title of the modal. |
content | string | Content of the modal. You can specify a string for simple text display or an HTML element for interactive config/setting menu. |
isLarge | boolean | undefined | Bigger modal. |
Methods
display
Displays a modal on top of the client.
note
This method will replace the current modal if there is one.
Parameter | Type | Description |
---|---|---|
content | Content | Information about the modal. |
Spicetify.PopupModal.display({
title: 'Hello World',
content: 'This is a simple text',
});
hide
Hides the current modal.
note
This method will hide any modal currently displayed via Spicetify.PopupModal.display
.
Spicetify.PopupModal.hide();