Property States

When you register a tool, you can also provide a function to manage property states. This is especially useful if you want to hide or show property editors when value of another property changes.

unlayer.registerTool({
  ...
  propertyStates: (values) => {
    if (values.textAlign === 'center') {
      return {
        textColor: {
          enabled: false
        }
      };
    }
  }
);

In the example above, we are hiding the textColor color picker when value of textAlign is set to center.