Skip to content
RhitottamPublic

About

A simple sdk for managing large media canvases

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

16 Commits

Folders and files

Repository files navigation

๐ŸŒ CloudGrid

A high-performance, infinite canvas library for React with WebAssembly-powered rendering

NPM Version License: MIT Demo

Build infinite canvas applications with 2000+ media items at 60 FPS. Powered by WebAssembly, Web Workers, and React.

CloudGrid Demo

๐Ÿš€ Quick Start

npm install @convadraw/cloudgrid
import { CloudGrid } from '@convadraw/cloudgrid';
import '@convadraw/cloudgrid/cloudgrid.css';

function App() {
  return (
    <div style={{ width: '100vw', height: '100vh' }}>
      <CloudGrid />
    </div>
  );
}

๐Ÿ“– Full Documentation โ€ข ๐ŸŽฎ Live Demo โ€ข ๐Ÿ“ฆ NPM Package

โœจ Features

Feature Description
๐Ÿš€ High Performance WebAssembly-powered canvas operations with spatial indexing
๐ŸŽจ 2000+ Items Handle thousands of media items smoothly at 60 FPS
๐Ÿ”„ Undo/Redo Full history management with batch operations
๐ŸŽฏ Smart Selection Multi-select with rubber band, group move/resize
๐Ÿ“ Grid Snapping Configurable grid with dynamic visual feedback
๐Ÿ” Smooth Zoom Animated camera controls with easing functions
๐ŸŽญ LOD System Level-of-detail rendering for optimal memory usage
๐Ÿงต Web Workers Non-blocking grid rendering and image processing
๐ŸŽจ Color Sorting Sort media by dominant RGB colors
๐Ÿ“ฆ TypeScript Full type safety and IntelliSense support

๐Ÿ“Š Performance

โœ… 2000+ media items at 60 FPS
โœ… <400MB memory usage with high-res images
โœ… Smooth animations with hardware acceleration
โœ… Non-blocking operations via Web Workers
โœ… Instant undo/redo for all operations

๐Ÿ—๏ธ Architecture

CloudGrid is built as a monorepo with multiple packages:

cloudgrid/
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ cloudgrid/       # Main React SDK
โ”‚   โ”œโ”€โ”€ wasm/            # WebAssembly module (AssemblyScript)
โ”‚   โ”œโ”€โ”€ editor/          # Core editor logic
โ”‚   โ”œโ”€โ”€ state/           # State management
โ”‚   โ””โ”€โ”€ primitives/      # Math utilities
โ””โ”€โ”€ apps/
    โ””โ”€โ”€ www/             # Demo application

Technology Stack

  • React 18 - UI framework with concurrent features
  • Konva.js - High-performance canvas rendering
  • AssemblyScript - WebAssembly compilation for critical operations
  • Web Workers - Background processing for grid rendering & image loading
  • Tailwind CSS v4 - Modern utility-first styling
  • TypeScript - End-to-end type safety
  • Turborepo - Fast, scalable monorepo build system

๐Ÿ“ฆ Packages

The main React SDK. This is what you install and use in your applications.

npm install @convadraw/cloudgrid

WebAssembly module for high-performance canvas operations:

  • Spatial indexing (Quadtree)
  • Viewport culling
  • Grid snapping
  • Command history (undo/redo)
  • Batch operations

Framework-agnostic editor logic.

Centralized state management.

Math utilities (vectors, boxes, snapping).

๐ŸŽฏ Use Cases

  • Design Tools: Build Figma-like design applications
  • Image Galleries: Infinite scrolling image galleries
  • Mood Boards: Create visual mood boards with 1000s of images
  • Photo Editors: Build photo organization and editing tools
  • Data Visualization: Visualize large datasets on infinite canvas
  • Whiteboarding: Real-time collaborative whiteboarding apps

๐Ÿšฆ Getting Started

1. Installation

npm install @convadraw/cloudgrid

2. Import CSS

import '@convadraw/cloudgrid/cloudgrid.css';

3. Use Component

import { CloudGrid } from '@convadraw/cloudgrid';

function App() {
  return <CloudGrid />;
}

4. Add Controls

import { CloudGrid, useCamera, selectItems, zoomToSelected } from '@convadraw/cloudgrid';

function App() {
  const camera = useCamera();

  return (
    <>
      <button onClick={() => camera.resetView()}>Reset</button>
      <CloudGrid />
    </>
  );
}

See full documentation โ†’

๐ŸŽฎ Demo

Try the live demo: https://yourusername.github.io/cloudgrid

Or run locally:

git clone https://github.com/yourusername/cloudgrid.git
cd cloudgrid
npm install
npm run dev

Open http://localhost:3000

๐Ÿงช Development

This is a Turborepo monorepo. To get started:

Prerequisites

  • Node.js 18+
  • npm 9+

Setup

# Clone the repository
git clone https://github.com/yourusername/cloudgrid.git
cd cloudgrid

# Install dependencies
npm install

# Build all packages
npm run build

# Run demo app
cd apps/www
npm run dev

Commands

npm run build        # Build all packages
npm run dev          # Start demo app
npm run lint         # Lint all packages
npm run test         # Run tests (when available)
npm run clean        # Clean build artifacts

Package Development

To develop a specific package:

# Build WASM module
cd packages/wasm
npm run build

# Build React SDK
cd packages/cloudgrid
npm run build

# Watch mode (auto-rebuild)
npm run build -- --watch

๐Ÿค Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Style

  • Use TypeScript for all new code
  • Follow existing code style (ESLint)
  • Add tests for new features
  • Update documentation

๐Ÿ“„ License

MIT ยฉ 2026 - see LICENSE for details

๐Ÿ™ Acknowledgments

  • Inspired by tldraw - Excellent infinite canvas library
  • Built with Konva.js - HTML5 2D canvas library
  • Icons by Phosphor Icons - Beautiful icon family
  • Styled with Tailwind CSS - Utility-first CSS framework

๐Ÿ“ž Support

๐Ÿ—บ๏ธ Roadmap

  • React Native support
  • Video support
  • Text editing
  • Real-time collaboration
  • Export to PNG/SVG
  • Layers & groups
  • Custom shapes
  • Pen tool
  • Animation timeline

โญ Star History

If you find CloudGrid useful, please consider giving it a star! โญ


Made with โค๏ธ by the CloudGrid team

About

A simple sdk for managing large media canvases

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages