Skip to main content

Delegate

The <sdpi-delegate> component enables the invocation of a sendToPlugin event, allowing for the persisted setting to be delegated to the plugin, and then rendered within this component.

tip

The <sdpi-delegate> component is useful for functionality that is not native to the property inspector, e.g. browsing for a folder.

Example​

Property Inspector HTML
<sdpi-item label="Delegate">
<sdpi-delegate
setting="delegated_value"
invoke="eventName"
label="...">
</sdpi-delegate>
</sdpi-item>

Result​

A delegated input in the Stream Deck property inspector using the sdpi-delegate web component

value

Unlike other components, the value of the <sdpi-delegate> component is determined by the plugin. When the component is invoked, a payload containing the invoke attribute is sent to the plugin using sendToPlugin with the following structure.

{
action,
event,
context,
payload: {
event: "eventName"
}
}

Once the plugin has set the persisted value, it is then rendered within the <sdpi-delegate> component using .toString().

Configuration​

The component supports the following configuration.

NameTypeDescription
defaultstringThe default value; shown when the persisted value is undefined.
disabledbooleanDetermines whether the input is disabled.
format-typestringType of formatting to be used when rendering the value (see Formatting).
labelstringLabel text shown within the button; defaults to an ellipsis.
invokestringThe payload.event name supplied to the plugin when the delegate is invoked.
valueunknownThe value of the component, and the persisted setting.

Formatting​

Supported format-type are:

  • path - The value is parsed as a local path, and the directory or file name is rendered.

Persistence​

The value of the component can be automatically persisted to the Stream Deck with the following configuration.

NameTypeDescription
globalbooleanWhen present, the value will be persisted to the global settings.
settingstringThe path of the property where the value should be persisted in the settings.
setting

The setting represents the path of a property. If required, this path can denote a nested property within the settings, e.g. if the setting were foo.bar.prop, the value would be saved to:

{
"foo": {
"bar": {
"prop": <value>
}
}
}