Skip to content

CornerToolbar

The CornerToolbar class represents a button group located in the top-right corner of a box.

Example:

js
import { CornerToolbar } from 'lakelib';

const cornerToolbar = new CornerToolbar({
  root: rootNode,
  items: [
    {
      name: 'remove',
      icon: '<svg>...</svg>',
      tooltip: 'Remove',
      onClick: () => {
        console.log('Button clicked');
      },
    },
  ],
});
cornerToolbar.render();

Constructor

Creates a new CornerToolbar instance. It receives a key-value object with the following properties as its parameter.

root

The container element where the toolbar will be appended.

items

An array of CornerToolbarItem objects defining the buttons to be rendered.

locale Optional

A TranslationFunctions object for internationalization.

Instance properties

container Read only

The element where the toolbar buttons are appended.

Example:

js
const container = cornerToolbar.container;

Instance methods

render()

Renders the corner toolbar. If no items are provided in the configuration, this method does nothing.

  • Parameters:

    None.

  • Return value:

    None.

Example:

js
cornerToolbar.render();

Released under the MIT License.