Config Schema

The SDK turns config.schema into:

  1. defaultConfig for your component

  2. configFields for the dashboard settings UI

Baseline Object Schema

const schema = {
  type: "object",
  required: ["attributes"],
  properties: {
    title: {
      type: "string",
      title: "Title",
      default: "",
    },
    useLiveData: {
      type: "boolean",
      title: "Use Live Data",
      default: true,
    },
    refreshSeconds: {
      type: "number",
      title: "Refresh seconds",
      min: 1,
      default: 5,
    },
  },
};

Supported Core Types

  • string

  • number

  • boolean

  • list

  • select

  • radio

  • multiselect

  • file

  • files

SDK Specific Shortcuts

  • Formatted text: INPUT_FORMATTED_SCHEMA_TYPE / INPUT_FORMATED_SCHEMA_TYPE

  • Tango selectors: INPUT_TANGO_ATTRIBUTES, INPUT_MULTIPLE_TANGO_ATTRIBUTES, INPUT_DEVICES, INPUT_DB, INPUT_MULTIPLE_DB

  • Dynamic host selectors: WORKSPACES, WORKSPACE, VARIABLES, VARIABLE

See Custom Inputs for value shapes and runtime normalization.

Concrete Patterns From Real Widgets

Components Table

  • Uses enum + enumNames for stable display labels (timeColumnFormat)

  • Uses level for role-gated settings

  • Stores advanced persisted table state in schema (columnOrder, columnWidths, sortKey, sortDir)

Grid Widget

  • Uses formatted template inputs (title, cellLabelFormat, selectedVariableFormat)

  • Uses dynamic options for workspace and variable selection

  • Uses grouped hover rows via INPUT_MULTIPLE_TANGO_ATTRIBUTES

Nested Data

Nested objects and arrays are supported. Defaults are merged into defaultConfig recursively.

Preview Derived Fields

import { deriveConfigFields } from "@ska-octopus-widget-sdk/widget-sdk";

const fields = deriveConfigFields(schema);
console.log(fields);