A simple JavaScript framework for Drawing on the web.(一个面向Web绘图的JavaScript框架)
Find a file
2026-03-29 16:01:33 +08:00
.github/workflows ci: update action scripts 2026-03-28 21:29:55 +08:00
.vscode chore: init eslint v9 2025-09-06 13:30:13 +08:00
__tests__ test: update unit test and e2e test 2023-04-02 12:10:48 +08:00
assets docs: add idraw.js logo 2023-12-24 16:53:17 +08:00
packages feat: change default features config 2026-03-29 15:21:15 +08:00
scripts ci: upgrade deps and improve build scripts 2026-03-29 15:57:09 +08:00
.eslintrc.js feat: init deep selector middleware 2023-06-10 18:09:11 +08:00
.gitignore build: add output esm/* to @idraw/util 2022-02-27 15:56:32 +08:00
.npmrc ci: fix npmrc 2026-03-28 21:26:36 +08:00
.prettierrc.json chore: improve prettier and eslint config 2025-09-06 18:51:20 +08:00
babel.config.js feat: init project 2021-05-23 20:16:15 +08:00
dev.md chore: update testing script 2021-06-10 12:02:08 +08:00
eslint.config.mjs chore: improve prettier and eslint config 2025-09-06 18:51:20 +08:00
jest.config.js feat: add history and fix text-editor middleware 2025-05-10 15:20:55 +08:00
jest.cover.js test: improve e2e test 2023-02-12 14:44:56 +08:00
jest.e2e.config.js test: update unit test and e2e test 2023-04-02 12:10:48 +08:00
jest.setup.js feat: add history and fix text-editor middleware 2025-05-10 15:20:55 +08:00
LICENSE doc: update LICENSE 2023-02-25 13:49:19 +08:00
package.json chore: bump version v1.0.0-alpha.3 2026-03-29 15:58:29 +08:00
pnpm-lock.yaml ci: upgrade deps and improve build scripts 2026-03-29 15:57:09 +08:00
pnpm-workspace.yaml feat: add studio to project 2023-05-20 10:08:25 +08:00
README.md doc: update readme for v1.x 2026-03-28 20:58:13 +08:00
tsconfig.json chore: improve build script 2023-02-12 11:39:24 +08:00
tsconfig.node.json ci: upgrade deps and improve build scripts 2026-03-29 15:57:09 +08:00
tsconfig.web.json feat: add history and fix text-editor middleware 2025-05-10 15:20:55 +08:00

iDraw.js Logo

iDraw.js

iDraw.js is a simple JavaScript framework for Drawing on the web.

一个面向Web绘图的JavaScript框架

idrawjs.com

CI Version License


Sponsors

iDraw.js is an MIT-licensed open source project with its ongoing development made possible entirely by the support of these awesome backers. If you'd like to join them, please consider sponsoring iDrawjs's development.

Become a Backer

@idraw/studio Preview

The preview of @idraw/studo. Click here to get it.

idraw-studio-light-theme idraw-studio-dark-theme

Install

npm i idraw

Getting Started

Common

import { iDraw } from 'idraw';

const idraw = new iDraw(
  document.querySelector('#app'),
  {
    width: 600,
    height: 400,
    devicePixelRatio: 1,
  }
);
idraw.addMaterial({
  name: "rect-1",
  type: "rect",
  x: 140,
  y: 120,
  width: 200,
  height: 100,
  fill: "#f7d3c1",
  strokeWidth: 4,
  stroke: "#ff6032",
  cornerRadius: 20,
});

React

import { iDraw } from 'idraw';
import { useEffect, useRef } from 'react';

function Demo() {
  const ref = useRef(null);
  useEffect(() => {
    const idraw = new iDraw(ref.current, {
      width: 600,
      height: 400, 
      devicePixelRatio: 1,
    });
    idraw.addMaterial({
      name: "rect-001",
      x: 140,
      y: 120,
      width: 200,
      height: 100,
      fill: "#f7d3c1",
      strokeWidth: 4,
      stroke: "#ff6032",
      cornerRadius: 20,
    })
  }, []);

  return (
    <div ref={ref}></div>
  )
}

Vue

<template>
  <div ref="mount"></div>
</template>

<script setup >
import { iDraw } from 'idraw';
import { ref, onMounted } from 'vue'
const mount = ref();

onMounted(() => {
  const idraw = new iDraw(mount.value, {
    width: 600,
    height: 400, 
    devicePixelRatio: 1,
  });
  idraw.addMaterial({
    name: "rect-001",
    x: 140,
    y: 120,
    width: 200,
    height: 100,
    fill: "#f7d3c1",
    strokeWidth: 4,
    stroke: "#ff6032",
    cornerRadius: 20,
  })
})
</script>

Contributing

We appreciate your help!

To contribute, please follow the steps:

  • git clone git@github.com:idrawjs/idraw.git
  • cd idraw
  • pnpm i
  • npm run dev