updateCustomTrayButtons()

updateCustomTrayButtons({ customButtonOne, customButtonTwo, ... })

Compatibility:
Prebuilt
Custom

Sets custom tray buttons in a Daily Prebuilt call according to a dictionary of custom buttons that you provide, analogous to how you would set customTrayButtons via DailyCall properties. Along with adding new buttons, the updateCustomTrayButtons() method enables you to change, replace, or remove existing buttons.

IMPORTANT: When calling this function the provided dictionary completely replaces the previous set of buttons. So if you only want to add a new button to an already existing set of buttons, you need to include any existing buttons as well.

ParameterTypeDescription
customButtonObjectHolds the config parameters for this particular custom button, including iconPath, iconPathDarkMode, label and tooltip. You can provide multiple custom button objects.

Here's an example of using updateCustomTrayButtons() to set two custom buttons at once:

A few things to note about that example:

  • If customButtonOne has already been set, it will be updated with this new configuration.
  • If customButtonTwo hasn't been set yet, it will be added.
  • If any other buttons have previously been set but do not appear in the dictionary you provide, updateCustomTrayButtons() implicitly removes them from the tray.

Also, because Daily Prebuilt runs in an <iframe>, the iconPath and iconPathDarkMode values must each be a URL, complete with the https: protocol string.