Skip to content

The controlled canvas component used by Multibility.

Notifications You must be signed in to change notification settings

slotDumpling/draft-pad

Repository files navigation

import { Draw, DrawState } from "draft-pad";
import { FC, useState } from "react";
const RATIO = 1.5;
const WIDTH = 2000;

const MyDraftPad: FC = () => {
  const [drawState, setDrawState] = useState(DrawState.createEmpty(RATIO, WIDTH));
  return <Draw drawState={drawState} onChange={setDrawState} />;
};