Linea is a minimal 2D CAD editor that runs entirely in the browser. It speaks the language drafters already know — model space, paper layouts, snaps, grips, layers, dimensions, DXF — with zero install and no accounts. Your drawings are .linea files on your own disk; the browser just keeps an autosaved working copy so a reload never loses work.
Blocks are parametric JavaScript. A block definition is a small script — typed parameters in, geometry out:
// surface.block.js
import { defineBlock } from "lineadraw";
export default defineBlock({
id: "9f6f9dd3-…", // unique — a UUID is a good choice
name: "Surface", // Visible name
params: [
{
name: "type",
type: "enum",
default: "rock",
options: ["rock", "ground"],
},
],
place: ["Start point", "End point"], // one point pick per label, in order
draw: ({ params, inputs: [start, end] }) => {
params.type; // "rock" | "ground" — inferred
return [{ type: "line", a: start, b: end }];
},
});Blocks can also declare geometric inputs — points you pick at placement — so a beam spans two picked ends and a fence runs along as many points as you click. Every anchor stays a drag grip afterwards.
- Draw — lines, polylines with arc bulges, circles, arcs, ellipses, hatches, text with leaders, and chained/angular/radial dimensions with a proper dimension style.
- Snap — endpoint, midpoint, center, quadrant, intersection, perpendicular, extension, nearest, plus ortho and polar tracking.
- Organize — layers with color, lineweight, and line types ("by layer" inheritance with per-object overrides).
- Lay out — multiple paper layouts with ISO sheets and first-class viewports, printed to accurate PDF from the same painting path as the canvas.
- Exchange — DXF import and export; the geometry model is deliberately DXF-shaped, so interchange stays a direct mapping.
React 19, TypeScript, Vite, zustand, zod — an npm workspace where @lineadraw/editor is a self-contained editor package and the web app is a thin shell around it, so the editor can be embedded in other hosts too.
Draw something: lineadraw.com