canvaskit-wasm 0.39 build 2026-04-29

CanvasKit

CanvasKit is Skia compiled to WebAssembly. It exposes the same drawing API the Chrome and Android engines use — paths, paints, shaders, image filters, runtime SkSL — at a low level, on a <canvas> element. This site documents the JavaScript surface as it ships in the canvaskit-wasm package, with a runnable demo on every page you can edit live.

const paint = new CK.Paint(); paint.setAntiAlias(true); const ring = new CK.Path(); ring.addCircle(210, 128, 90); ring.addCircle(210, 128, 60); ring.setFillType(CK.FillType.EvenOdd); const blur = CK.MaskFilter.MakeBlur(CK.BlurStyle.Normal, 6, true); let t = 0; loop(() => { t += 0.02; canvas.clear(CK.WHITE); paint.setColor(CK.Color(40, 90, 180, 0.6)); paint.setMaskFilter(blur); canvas.drawPath(ring, paint); paint.setColor(CK.Color(220, 60, 60, 1)); paint.setMaskFilter(null); canvas.save(); canvas.translate(210, 128); canvas.rotate(t * 30, 0, 0); canvas.drawRect(CK.LTRBRect(-50, -4, 50, 4), paint); canvas.restore(); surface.flush(); });

Where to start

If you've never used CanvasKit before, read these in order:

  1. Bundler integration — getting the WASM binary into your build.
  2. Memory management — every CanvasKit object is in WASM memory; you .delete() what you allocate.
  3. SurfaceCanvasPaint — the three objects every program touches.
  4. Path — once you have shapes you can fill, stroke, clip, and union with PathOp.

After that the site is a reference. Use the sidebar tree (or / to focus search) to look things up.

How the docs are organized

The sidebar has five sections.

Hover any link inside an article to preview the target page. The first paragraph plus (for enums) the value table appear in a tooltip — saves a click when you're skimming.

What's not here

This site documents the build of CanvasKit used to author it: canvaskit-wasm 0.39 with font, text, paragraph layout, and Skottie / Lottie stripped out. Those work in the upstream "full" build but aren't part of this surface, so they're not documented here. If you're rendering text or playing Lottie animations, look at upstream's typings — the API shape is the same, just present.

A few namespaces are intentionally hidden because they're shared with our internal vector tooling and not part of the public CanvasKit (FGraph, FBoolean). They won't appear in autocomplete or search.

Live demos

Every demo on this site is real. Click into one — the editor lights up, autocomplete shows the same symbol DB the sidebar does, errors render inline, and the canvas re-renders as you type. Two helpers are added on top of stock CanvasKit specifically for the docs:

  • loop(fn)requestAnimationFrame driver with a lifecycle that's reset between edits.
  • canvas.drawAnchors(path) and canvas.drawTangents(path) — debug helpers that visualize the verbs and control points inside a Path (details).

Demos run a tracking proxy over CK, so anything you new or Make is auto-deleted between runs. Production code doesn't get this — see memory management.

Useful elsewhere