@massivebox/material-icons (1.34.0)
Installation
@massivebox:registry=npm install @massivebox/material-icons@1.34.0"@massivebox/material-icons": "1.34.0"About this package
@massivebox/material-icons
A 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.
Usage
With a bundler
If using a bundler (e.g. webpack), it should be possible to add @massivebox/material-icons as a dependency and import it directly.
For example,
import Editor from '@massivebox/js-draw';
import { MaterialIconProvider } from '@massivebox/material-icons';
import '@massivebox/js-draw/bundledStyles';
const editor = new Editor(document.body, {
iconProvider: new MaterialIconProvider(),
});
// Add a toolbar that uses the icons
editor.addToolbar();
From a CDN
It's also possible to include js-draw and @massivebox/material-icons from a CDN.
For example, with JSDelivr,
<script src="https://cdn.jsdelivr.net/npm/js-draw@1.23.1/dist/bundle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@massivebox/material-icons@1.23.1/dist/bundle.js"></script>
Then, in a script,
// makeMaterialIconProviderClass provides @massivebox/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.1should be replaced with the latest versions ofjs-drawand@massivebox/material-icons. - Consider including an including an
integrity="..."attribute on the<script>tags. Read more about using SRI with JSDelivr.
Dependencies
Development dependencies
| ID | Version |
|---|---|
| @massivebox/build-tool | ^1.34.0 |
| @massivebox/js-draw | ^1.34.0 |
Peer dependencies
| ID | Version |
|---|---|
| @massivebox/js-draw | ^1.0.1 |
Details
2026-08-03 09:46:26 +00:00
Assets (1)
Versions (3)
View all
npm
8
Henry Heino
(MIT AND Apache-2.0)
158 KiB
material-icons-1.34.0.tgz
158 KiB