A lightweight, interactive React application that allows users to draw rectangles anywhere on the screen by simply clicking and dragging. Ideal for image annotation, design mockups, or UI testing tools.
- 🖱️ Click-and-drag to draw rectangles
- 📦 Built using React (Hooks & functional components)
- 🔄 Real-time rendering while dragging
- ♻️ Customizable rectangle properties (coming soon)
- 🧰 Minimal dependencies, easy to extend
git clone https://github.com/your-username/react-rectangle-drawer.git
cd react-rectangle-drawernpm install
# or
yarn installnpm start
# or
yarn startThe app will run at http://localhost:3000.
- Click anywhere on the canvas to start drawing
- Drag to define the size of the rectangle
- Release the mouse to finish drawing
All rectangles are rendered live and stored in memory.
src/
├── components/
│ └── RectangleCanvas.tsx # Main drawing logic
├── App.tsx # Entry component
├── index.tsx # React DOM mount
└── styles.css # Basic styling
- Resize or move rectangles
- Save drawn data to backend
- Add labels/tags to rectangles
- Export data (JSON/CSV)
Feel free to fork this repo, improve it, and submit PRs!