Customizing an existing annotation tool in our viewer toolbar
It’s possible to customize the following properties of built-in items:
titleclassNamedisabledonPress
In the example below, we add a custom onPress handler to the first item of the ink annotation toolbar:
NutrientViewer.load({ // ...otherOptions annotationToolbarItems: ( annotation, { defaultAnnotationToolbarItems } ) => { if (annotation instanceof NutrientViewer.Annotations.InkAnnotation) { defaultAnnotationToolbarItems[0].onPress = () => alert("Custom onPress handler!"); return defaultAnnotationToolbarItems; } return defaultAnnotationToolbarItems; }});See the API reference to learn more about each individual property.
When you set onPress, it’s added to the parent of the built-in annotation toolbar item.