Type representing a viewer's toolbar instance.

Hierarchy

  • Toolbar

Properties

desktop: ToolbarItems

Desktop layout toolbar items.

Example

Usage example:

viewer.toolbar.desktop.addItem({
key: 'coolButton',
title: 'Cool Button',
iconCssClass: 'mdi mdi-emoticon-cool',
action: () => {
console.log('Cool!');
}}
)
fullscreen: ToolbarItems

Fullscreen mode toolbar items.

Example

Usage example:

viewer.toolbar.fullscreen.addItem({
key: 'fishButton',
title: 'Fish',
iconCssClass: 'mdi mdi-fish',
action: () => {
console.log('Just a fish.');
}}
)
mobile: ToolbarItems

Mobile layout toolbar items.

Example

Usage example:

viewer.toolbar.mobile.addItem({
key: 'pizzaButton',
title: 'Cool Pizza',
iconCssClass: 'mdi mdi-pizza',
action: () => {
console.log('Pizza Time!');
}}
)
toggle: ((show?) => void)

Type declaration

    • (show?): void
    • Toggles the toolbar visibility.

      Parameters

      • Optional show: boolean

        Pass true to switch toolbar ON, and vise-versa. Do not pass any value to toggle visibility.

      Returns void

      Example

      Usage example:

      viewer.toolbar.toggle(false); // hide toolbar