Hiding or customizing visual components is a key part of tailoring the WebViewer UI to your application’s needs. With Webviewer UI you can leverage its modularity to hide visual elements from headers, but also use data-elements to hide specific elements in other areas such as panels and modals.
With the introduction of the Modular UI, you no longer need to rely on data-element attributes to show or hide individual controls. Instead, you can use the Modular UI APIs to replace entire groups of items in one go—giving you far more flexibility.
For example, suppose you only want the Shapes and Edit ribbons in your toolbar. Instead of hiding every other ribbon by its data-element, you can filter out the ones you don’t need and call setItems:
This approach also works for removing dividers or any other components: simply filter them out of the items array and call setItems on the container, header, or grouped-items you’re targeting. In the previous example, we filtered by dataElement, but you can also filter by other properties, such as type.
For instance, to remove all dividers from the Default Top Header, which are located in the groupedLeftHeaderButtons container, you could write:
For non-Modular UI components, you can still hide or show DOM elements by targeting their data-element attribute. To find the correct value, inspect the element in the DOM. For example, if we inspect the left panel,

we can find that it has a data-element value of leftPanel. Now we can use that value to hide/show it.
You can view the full list of data elements in our open source UI repo.
If you wish to disable elements before the initial render there are two options. You can disable by loading an initial configuration file that only includes the items you wish to render, or you can pass a list of data-elementsthat you wish to disable.
This can be done using a JSON config file in which you can define the Modular Components (ie. Buttons, Ribbon Items, Grouped Items), Modular Headers, Flyouts, and Panels that you want to use and then importing it into the UI.
In the example above, a functionMap is also used to define the onClick functions for the buttons. For more details on the import and export of configurations and the usage of functionMaps please refer to this guide.
Pass a list of data-elements in the disabledElements constructor option to hide elements.
Example
To enable/disable the DOM elements, you can use the following APIs:
Example
Note that these are different from opening/closing elements. Instead of changing visibility, these APIs will actually remove/re-render elements in the DOM. To change visibility, you can refer to the sample below.
You can toggle panels, overlays, popups, and modals.
Example
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales