# idraw **Repository Path**: idrawjs/idraw ## Basic Information - **Project Name**: idraw - **Description**: 一个面向Web绘图的JavaScript框架。(A simple JavaScript framework for Drawing on the web.) - **Primary Language**: TypeScript - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 3 - **Created**: 2021-08-05 - **Last Updated**: 2025-06-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

iDraw.js Logo

iDraw.js

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

一个面向Web绘图的JavaScript框架

idrawjs.com

CI Version License


- [Documents](https://idrawjs.com/docs/en-US/) | [中文文档](https://idrawjs.com/docs/zh-CN/) - [Online Playground](https://idrawjs.com/playground/) | [在线API示例](https://idrawjs.com/playground/) - [Online Studio](https://idrawjs.com/studio/) | [在线绘图演示](https://idrawjs.com/studio/) ## 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](https://opencollective.com/idrawjs). [![Become a Backer](https://opencollective.com/idrawjs/tiers/backers.svg?avatarHeight=48)](https://opencollective.com/idrawjs) ## @idraw/studio Preview The preview of `@idraw/studo`. Click [here](https://github.com/idrawjs/studio) to get it.

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

## Install ``` npm i idraw ``` ## Getting Started ### Common ```js import { iDraw } from 'idraw'; const idraw = new iDraw( document.querySelector('#app'), { width: 600, height: 400, devicePixelRatio: 1, } ); idraw.addElement({ name: "rect-1", x: 140, y: 120, w: 200, h: 100, type: "rect", detail: { background: "#f7d3c1", borderRadius: 20, borderWidth: 4, borderColor: "#ff6032", }, }); ``` ### React ```jsx 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.addElement({ name: "rect-001", x: 140, y: 120, w: 200, h: 100, type: "rect", detail: { background: "#f7d3c1", borderRadius: 20, borderWidth: 4, borderColor: "#ff6032", }, }) }, []); return (
) } ``` ### Vue ```html ``` ## 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`