Module Input Field Types
Companion has a standardised set of input fields usable across action, feedback, or user-config definitions.
There are some small differences in what is available where, documented here.
Option types
When defining actions, feedbacks and module config definitions, the object includes a property called options: that takes a list of input-field definitions. For example,
{
action1: {
name: 'My First Action',
description: 'a bit more detail',
options: [
{
type: 'number',
label: 'Source',
id: 'source',
default: 1,
},
{
type: 'dropdown',
id: 'camera',
label: 'Select Camera',
choices: [
{ id: 'a', label: 'Camera A' },
{ id: 'b', label: 'Camera B' },
],
default: 'a',
},
],
callback: (event) => {
// report the user-selected options:
console.log(JSON.stringify(event.options))
}
}
}
All the types are described in the auto-generated api documentation, linked below. Unfortunately it is only possible to view the documentation for the latest version of @companion-module/base, but we do our best to clarify when things were added inside the documentation.
There are some common properties across every type of input. Each type can also take additional properties as documented:
- Static Text
type: 'static-text' - Text
type: 'textinput' - Color Picker
type: 'colorpicker' - Dropdown
type: 'dropdown' - Multi Dropdown
type: 'multidropdown' - Checkbox
type: 'checkbox' - Number
type: 'number'
Actions also accept:
- Custom Variable
type: 'custom-variable'
User-Config options also accept:
- Bonjour Device
type: 'bonjour-device' - Input Field Secret
type: 'secret-text'
Further Readings
It is possible that there are some new field types not linked to in the list above. You can discover these in the 'Hierarchy' section of the CompanionInputFieldBase doc page, or for the specific uses: Here's a starting point for action input fields, for feedback input fields and for user-config input fields