Config Schema
The SDK turns config.schema into:
defaultConfigfor your componentconfigFieldsfor 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
stringnumberbooleanlistselectradiomultiselectfilefiles
SDK Specific Shortcuts
Formatted text:
INPUT_FORMATTED_SCHEMA_TYPE/INPUT_FORMATED_SCHEMA_TYPETango selectors:
INPUT_TANGO_ATTRIBUTES,INPUT_MULTIPLE_TANGO_ATTRIBUTES,INPUT_DEVICES,INPUT_DB,INPUT_MULTIPLE_DBDynamic host selectors:
WORKSPACES,WORKSPACE,VARIABLES,VARIABLE
See Custom Inputs for value shapes and runtime normalization.
Concrete Patterns From Real Widgets
Components Table
Uses
enum+enumNamesfor stable display labels (timeColumnFormat)Uses
levelfor role-gated settingsStores 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);
Recommended Rules
Use schema
defaultas the single source of truth.Prefer explicit
titleanddescriptionfor every user visible field.Keep operational/internal persistence fields hidden or role gated when appropriate.