components / drawing-window
drawing-window.
floating, draggable, resizable paint window: brush/eraser, colors, undo/redo, zoom + pan, and canvas-size presets. save emits png(s) via onSave, or downloads.
open a window, draw, save to preview here.
installation
bunx @justin06lee/chrome@latest add drawing-windowprops
| name | type | default | description |
|---|---|---|---|
| title | string | 'drawing' | |
| subtitle | string | - | |
| initialPosition | { x: number; y: number } | { x: 72, y: 120 } | |
| initialSize | { width: number; height: number } | { width: 780, height: 720 } | |
| active | boolean | true | highlights the border and enables wheel-zoom. |
| zIndex | number | 80 | |
| onClose | () => void | - | |
| onFocus | () => void | - | |
| saving | boolean | - | controlled saving flag. |
| disableSave | boolean | false | |
| darkMapping | boolean | false | draw in light colors remapped to a dark variant. |
| presets | DrawingPreset[] | - | |
| colors | string[] | - | hex swatches; defaults depend on darkMapping. |
| brushSizes | number[] | [4, 10, 18] | |
| onSave | (result: { dataUrl: string; darkDataUrl?: string }) => void | Promise<void> | - | omit to download the png instead. |
| className | string | - |