Start with one package boundary. Add engines only when the product needs them.
Use @pixxl-tools/components for generic React UI, tokens, icons, website patterns, and browser hooks.
Use @pixxl-tools/canvas for CanvasDocument, editor/controller, history, workspace math, and reusable canvas-app chrome.
Add cantext, candraw, cangraph, or canchart for product-specific editing and rendering.
Use @pixxl-tools/compare for React-free text and pixel comparison helpers.
Install the package and import its CSS once at the application root.
pnpm add @pixxl-tools/components
import { Button, Stack, Text } from "@pixxl-tools/components";
import "@pixxl-tools/components/styles.css";
export function SavePanel() {
return (
<Stack gap="sm">
<Text>Ready to save.</Text>
<Button tone="primary">Save document</Button>
</Stack>
);
}Core document and editor APIs work without React or browser UI.
pnpm add @pixxl-tools/canvas
import { createCanvasDocument, createCanvasEditor } from "@pixxl-tools/canvas";
const editor = createCanvasEditor({
document: createCanvasDocument({ width: 1024, height: 768 }),
});
editor.addText("Hello canvas", {
x: 64,
y: 64,
width: 240,
height: 48,
});
const saved = editor.getDocument();Render the example and confirm the browser console has no errors or warnings.
Reload the saved CanvasDocument and verify IDs, page references, and product payloads round-trip.
Run your application typecheck and production build before adding more packages.
Use the troubleshooting guide before importing internal source paths or adding workarounds.