Material icon pack for js-draw.
npm install @js-draw/material-icons@js-draw/material-iconsA material icon pack for js-draw.
The icons in this pack are licensed under the Apache 2.0 License. See the icon pack's GitHub repository.
If using a bundler (e.g. webpack), it should be possible to add @js-draw/material-icons as a dependency and import it directly.
For example,
``ts
import Editor from 'js-draw';
import { MaterialIconProvider } from '@js-draw/material-icons';
import 'js-draw/bundledStyles';
const editor = new Editor(document.body, {
iconProvider: new MaterialIconProvider(),
});
// Add a toolbar that uses the icons
editor.addToolbar();
`
It's also possible to include js-draw and @js-draw/material-icons from a CDN.
For example, with JSDelivr,
`html`
Then, in a script,
`js
// makeMaterialIconProviderClass provides @js-draw/material-icons with an instance of the js-draw library.
const MaterialIcons = jsdrawMaterialIcons.makeMaterialIconProviderClass(jsdraw);
const editor = new jsdraw.Editor(document.body, {
iconProvider: new MaterialIcons(),
});
editor.addToolbar();
`
Notes:
- Above, 1.23.1 should be replaced with the latest versions of js-draw and @js-draw/material-icons.integrity="..."
- Consider including an including an attribute on the