Canvas
A freehand drawing surface with pen and eraser tools, color palette, variable stroke widths, undo/redo, and PNG download.
Installation
npx dafink-ui add canvasDemo
Props
| Name | Type | Default | Description |
|---|---|---|---|
| width | number | container width | Canvas width in px. Defaults to responsive container width. |
| height | number | 400 | Canvas height in px. |
| defaultColor | string | '#18181b' | Initial stroke color. |
| defaultStrokeWidth | number | 4 | Initial stroke width in px. |
| showToolbar | boolean | true | Whether to render the built-in toolbar. |
| className | string | "" | Extra classes on the wrapper div. |