Skip to content

QuickSettings

QuickSettings exposes an easy api to add a settings menu to your plugin. Settings are automatically saved when changed. The supported elements are heading, boolean, number, and text. All options can be seen below.

/**
* @needsLib QuickSettings | https://raw.githubusercontent.com/Gimloader/client-plugins/refs/heads/main/libraries/QuickSettings/build/QuickSettings.js
*/
// Create a settings menu that this plugin can use
const settings = api.lib("QuickSettings")("MyPlugin", [
{
type: "heading",
text: "Some Settings"
},
{
type: "boolean",
id: "bool",
title: "A boolean!",
default: true
},
{
type: "number",
id: "num",
title: "A number!",
default: 10,
min: 0,
max: 100,
step: 1
},
{
type: "text",
id: "name",
title: "Your name",
maxLength: 18,
default: "Josh"
}
]);
// Listen to changes to settings
settings.listen("bool", (val) => console.log("bool changed to", val));
settings.listen("num", (val) => console.log("num changed to", val));
settings.listen("name", (val) => console.log("name changed to", val));
// Get the value of settings
console.log("The boolean is", settings.bool);
console.log("The number is", settings.num);
console.log("The name is", settings.name);
// Register the openSettingsMenu function
api.openSettingsMenu(settings.openSettingsMenu);