DEV Community

MD Taseen Khan
MD Taseen Khan

Posted on • Originally published at reactjsexample.com on

A nicely labelled canvas grid that adapts to a transform automatically

react-supergrid

A nicely labelled canvas grid that adapts to a transform automatically

Easily create a grid with infinitely nesting subgrid cells.

A nicely labelled canvas grid that adapts to a transform automatically

import React from "react"
import { SuperGrid } from "react-supergrid"
import { useMouseMatrixTransform } from "use-mouse-matrix-transform"

export const MyApp = () => {
  const { transform, ref } = useMouseMatrixTransform()

  return (
    <div ref={ref}>
      <SuperGrid width={1000} height={1000} transform={transform} />
    </div>
  )
}
Enter fullscreen mode Exit fullscreen mode

GitHub

View Github

Top comments (0)