Remove all tools from the inline text selection toolbar
The inline text selection toolbar in Nutrient Web SDK provides predefined tools for text annotation. You can remove all tools from this toolbar to completely hide it or prepare for a custom configuration.
This is helpful for scenarios such as:
- Hiding the toolbar entirely for read-only documents
- Creating a completely custom toolbar without default items
- Simplifying the interface for specific document types
- Disabling text selection interactions temporarily
Removing all tools hides the toolbar, but users can still select text. To completely disable text selection in the document, use the
disableTextSelectionconfiguration property instead.
Removing all tools at configuration time
You can remove all toolbar items when initially loading the SDK using the Configuration object:
NutrientViewer.load({ // ...other options. inlineTextSelectionToolbarItems: ( { defaultItems, hasDesktopLayout }, selection ) => { // Return an empty array to remove all tools. return []; }});Returning an empty array removes all toolbar items, effectively hiding the inline text selection toolbar.
Removing all tools after loading
You can also remove all toolbar items after the SDK has loaded using instance.setInlineTextSelectionToolbarItems. This approach is useful when you need to toggle the toolbar visibility dynamically:
instance.setInlineTextSelectionToolbarItems( ({ defaultItems, hasDesktopLayout }, selection) => { // Return an empty array to remove all tools. return []; });This method enables you to control toolbar visibility at runtime, which is helpful for scenarios such as:
- Switching between edit and read-only modes
- Responding to user permission changes
- Toggling toolbar visibility based on document type or state
Related guides
- Remove a tool — Remove specific tools from the inline text selection toolbar
- Create a new tool — Add custom tools to the toolbar
- Customize existing tools — Modify properties of built-in toolbar items
- Rearrange items — Change the order of toolbar items