markmap-toolbar

NPM

Create a toolbar for a markmap.

Installation

$ npm install markmap-toolbar

Usage

Assume we have created a markmap named mm. See markmap-view for more details.

There are two ways to import 'markmap-toolbar':

// load with <script>
const { markmap } = window;
const { Toolbar } = markmap;

// or as ESM
import { Toolbar } from 'markmap-toolbar';

Now create a toolbar and attach it to the markmap:

const { el } = Toolbar.create(mm);
el.style.position = 'absolute';
el.style.bottom = '0.5rem';
el.style.right = '0.5rem';

// `container` could be the element that contains both the markmap and the toolbar
container.append(el);