[]
        
(Showing Draft Content)

Toolbar

Interface: Toolbar

Type representing a viewer's toolbar instance.

Properties

desktop

desktop: ToolbarItems;

Desktop layout toolbar items.

Example

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

fullscreen

fullscreen: ToolbarItems;

Fullscreen mode toolbar items.

Example

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

mobile

mobile: ToolbarItems;

Mobile layout toolbar items.

Example

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

toggle()

toggle: (show?) => void;

Toggles the toolbar visibility.

Parameters

show?

boolean

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

Returns

void

Example

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