Draw (candraw)
Loading
Rectangle, rounded rectangle, ellipse, polygon, and derived closed paths.
Move, line, quadratic, cubic, and close segments with boolean operations.
Canvas text blocks and raster images share transform, layer, and style controls.
import { createCanvasController } from "@pixxl-tools/candraw";
const canvas = createCanvasController();
canvas.dispatch({
type: "candraw/rectangle/add",
transform: { x: 24, y: 24, width: 160, height: 96, rotation: 4 },
options: {
id: "hero-card",
name: "Hero card",
style: {
fill: "var(--pixxl-color-surface)",
stroke: "var(--pixxl-color-text)",
},
},
});
canvas.destroy();