Developer Portal
Quick StartsComposition scriptingAPIs and SDKsSupport
  • Portal overview
  • Quick start
  • REST API
    • Introduction
    • Rate limits
    • Authorization
    • How-to guides
      • Get a control app's API token
      • Get a composition's sub-composition IDs and names and their payload structures
      • Get a control app's model
      • Get a control app's metadata
      • Update a sub-composition's content
      • Update a sub-composition's animation state
      • Update a sub-composition's content and animation state in one call
      • Update multiple sub-compositions in one call
    • API reference
      • Get control app details
        • Get a control app's metadata
        • Get a control app's model
        • Get a control app's control data
      • Send data to a control app
        • Update a control app's content
        • Update a control app's animation state
      • Take out all of an app's output
  • Data stream API
    • Introduction
    • Rate limits
    • Authorization
    • How-to guides
      • Create a data stream
      • Link a data stream to a composition
      • Send data to an app using the data stream API
    • API reference
  • Composition scripting
    • Introduction
    • Overview
    • Quick start
      • Find sub-compositions and widgets
      • Read and update control nodes
      • Set text widget text properties
      • Read and update widget properties
      • Read control nodes and update widget properties
      • Set image widget URL property
      • Set table widget content property
    • Cheat sheets
      • Fundamentals
      • Interactive overlays
      • Best practices
    • Use cases
      • Read control nodes and generate HTML text
      • Read control nodes, generate HTML text with background
      • Text Ticker - Start ticker on "In" animation
    • Composition script editor reference
  • Software development kits
    • Graphics SDK
      • Getting started
      • Reference
        • SDK functions
        • Composition object
        • Sequencer object
      • Guides and examples
        • Load a composition with its token
        • Load a composition with its URL
        • Get the composition URL of an app instance
        • Sequencer VOD example
        • Control local preview of app
        • Load app instance output
    • Overlay SDK
      • Getting started
      • SDK functions
      • Use case examples
    • Widget SDK
      • Preparing your environment
      • Getting started
      • Reference
        • Widget UI definition
        • Widget callback functions
        • Time control object
        • Composition instance
      • Guides and examples
        • Widget example: CSS patterns
    • App SDK
  • Singular Basics
    • Overview of Singular
    • Managing overlays in the Dashboard
      • How to create a new composition
      • How to open a new app template
      • How to create an app for a composition
      • How to extract a composition from an app
      • How to find an app's shared app token and shared API URL
      • Dashboard reference
    • Building overlays in Composer
      • How to build a composition
      • How to set up layer logic to automate overlay transitions
      • How to set up control nodes to make widget properties available to a control app
      • Animating overlays
        • How to create timeline animations
        • How to create behavior animations
        • How to create update animations
      • How to make overlays interactive
      • How to adapt overlays to various screen sizes
      • Composer reference
    • Controlling overlays in Studio and UNO
      • How to use Studio
      • Studio reference
      • UNO reference
  • Support
    • Singular status
    • Support resources
    • Singular terminology
    • Performance Testing
Powered by GitBook
On this page
  • Defining UI fields
  • Grouping UI fields
  • Widget UI definition - full reference

Was this helpful?

  1. Software development kits
  2. Widget SDK
  3. Reference

Widget UI definition

The widget UI definition contains field and group definitions in a JSON structure.

Defining UI fields

The minimal definition of a fields includes the id, type, title, and defaultValue.

Field model property
Type
Description

id

string

(required) - field id returned in the JSON data by onSingularValue()

type

string

(required) - type of data (infotext, text, textarea, number, checkbox, composition, button, selection, JSON, color, gradient, image, timecontrol)

title

string

Field title displayed in the widget UI

defaultValue

string

Default value

UI field definition
{
  "model": {
    "fields": [
      {
        "id": "textId",
        "type": "text",
        "title": "Single line text",
        "defaultValue": "enter text here ..."
      },
      {
        "id": "numberId",
        "type": "number",
        "title": "Number",
        "defaultValue": "50",
        "min": "0",
        "max": "100",
        "step": "0.1",
        "unit": "%",
        "format": "0.1"
      }
    ],
    "groups": [...]
  }
}

Grouping UI fields

Use groups to arrange UI fields in cards.

Group properties:

Field
Type
Description

id

string

(required) - group id

title

string

Group title

width

string

Width of card single (default) or double

toolTip

string

Tool tip trext

childIds

array of strings

Array of UI field ids

Group definition
{
  "model": {
    "fields": [...],
    "groups": [
      {
        "id": "groupId",
        "title": "Input Options",
        "width": "double",
        "toolTip": "Enter your values",
        "childIds": [
          "textId",
          "numberId"
        ]
      }
    ]
  }
}

Widget UI definition - full reference

{  
  "model": {
    "fields": [{
        "id": "infotextId",
        "type": "infotext",
        "title": "Info",
        "defaultValue": "this is a readonly text..."
      },
      {
        "id": "textId",
        "type": "text",
        "title": "Single line text",
        "defaultValue": "enter text here ..."
      },
      {
        "id": "textAreaId",
        "type": "textarea",
        "title": "Text Area",
        "defaultValue": "Enter text into this area...",
        "rows": "5",
        "cols": "15"
      },
      {
        "id": "numberId",
        "type": "number",
        "title": "Number",
        "defaultValue": "50",
        "min": "0",
        "max": "100",
        "step": "0.1",
        "unit": "%",
        "format": "0.1"
      },
      {
        "id": "checkboxId",
        "type": "checkbox",
        "title": "Enable",
        "defaultValue": false
      },
      {
        "id": "compositionId",
        "type": "composition",
        "title": "Composition",
        "defaultValue": ""
      },
      {
        "id": "buttonId",
        "type": "button",
        "title": "Click me",
        "defaultValue": ""
      },
      {
        "id": "selectionId",
        "type": "selection",
        "title": "Selection",
        "defaultValue": "0",
        "selections": [{
            "id": "0",
            "title": "Option 1"
          },
          {
            "id": "1",
            "title": "Option 2"
          },
          {
            "id": "2",
            "title": "Option 3"
          }
        ]
      },
      {
        "id": "jsonId",
        "type": "json",
        "title": "Json data",
        "defaultValue": "{}",
        "width": "350",
        "height": "200"
      },
      {
        "id": "useCustomParameterId",
        "type": "checkbox",
        "title": "Enable",
        "defaultValue": false
      },
      {
        "id": "colorId",
        "type": "color",
        "title": "Color",
        "defaultValue": "#9B9B9B"
      },
      {
        "id": "gradientId",
        "type": "gradient",
        "title": "Gradient",
        "defaultValue": "#9B9B9B"
      },
      {
        "id": "imageId",
        "type": "image",
        "title": "Image",
        "defaultValue": "https://app.singular.live/images/logo.png"
      }, {
        "id": "countdownControlId",
        "title": "TimeControl",
        "type": "timecontrol",
        "defaultValue": {
          "UTC": 0,
          "isRunning": false,
          "value": 0
        }
      }
    ],
    "groups": [{
        "id": "group1Id",
        "title": "Input Options",
        "width": "double",
        "toolTip": "Enter your values and define a custom widget composition",
        "childIds": ["infotextId", "textId", "textAreaId", "numberId", "checkboxId", "selectionId", "compositionId"]
      },
      {
        "id": "group2Id",
        "title": "Customize and Control Options",
        "width": "double",
        "toolTip": "Customize and control options",
        "activeId": "useCustomParameterId",
        "childIds": ["jsonId", "colorId", "gradientId", "imageId", "countdownControlId", "buttonId"]
      }
    ]
  }
}
PreviousReferenceNextWidget callback functions

Last updated 2 years ago

Was this helpful?