Skip to content

Universal DevTools Kit SDK


Universal DevTools Kit SDK / @u-devtools/core / SettingSchemaDef

Interface: SettingSchemaDef ​

Defined in: index.ts:373

Setting schema definition for a single setting. Used to define user-configurable settings that appear in the DevTools settings panel.

Example ​

typescript
const pluginWithSettings: PluginClientInstance = {
  name: 'My Plugin',
  icon: 'Cube',

  settings: {
    fontSize: {
      label: 'Font Size',
      description: 'Base font size for the plugin',
      type: 'number',
      default: 14,
    },
    theme: {
      label: 'Theme',
      type: 'select',
      default: 'dark',
      options: [
        { label: 'Dark', value: 'dark' },
        { label: 'Light', value: 'light' },
      ],
    },
  },

  renderMain(container, api) {
    // Access settings
    const fontSize = api.settings.get('fontSize', 14);
    const theme = api.settings.get('theme', 'dark');

    return () => {};
  }
};

Properties ​

default? ​

optional default: unknown

Defined in: index.ts:381

Default value


description? ​

optional description: string

Defined in: index.ts:377

Optional description/tooltip text


items? ​

optional items: Record<string, SettingSchemaDef>

Defined in: index.ts:385

Schema for array items (for 'array' type with object items)


itemType? ​

optional itemType: "string" | "number"

Defined in: index.ts:387

Item type for 'array' type with primitive items ('string' or 'number')


label ​

label: string

Defined in: index.ts:375

Display label for the setting


options? ​

optional options: object[]

Defined in: index.ts:383

Options for 'select' type settings

label ​

label: string

value ​

value: unknown


type ​

type: SettingType

Defined in: index.ts:379

Setting type (determines input component)

Released under the MIT License.