Skip to content


Lastest Version



There are three ways of adding iDraw.js to a project:

  1. Install it using NPM.
  2. Import it as a CDN Package on the page.
  3. Download the JavaScript file and host them yourself.


NPM is the recommended installation method when building large scale with iDraw.js. It pairs nicely with module bundlers such as Webpack, Rollup or Vite.

npm install idraw


For prototyping or learning purposes, you can use the latest version with:

<script src=""></script>
<!-- use global value -->
  (function () {
    const { iDraw } = window.iDraw;
    const app = document.querySelector('#app');
    const idraw = new iDraw(app, {
      width: 600,
      height: 400,
      devicePixelRatio: 2

Download and Self Host

If you want to avoid using build tools but can't use CDN in production then you can download the relevant .js file and host it using your own web server. You can include it using a <script> tag, just like with the CDN approach.

The files can be browsed and download from a CDN such as unpkg .