@cadview Documentation

// framework-agnostic CAD/DXF/DWG viewer for the web

@cadview is a zero-dependency CAD file viewer that runs entirely in the browser. It parses DXF files, renders them on an HTML5 Canvas, and provides interactive tools for panning, selecting entities, and measuring distances.

Architecture

The library is split into focused packages that you compose together:

PackageDescriptionLicense
@cadview/coreParser, renderer, and viewer engineMIT
@cadview/reactReact 18/19 component & hookMIT
@cadview/svelteSvelte 5 componentMIT
@cadview/vueVue 3 component & composableMIT
@cadview/dwgDWG file support via LibreDWG WASMGPL-3.0

The core package has only one runtime dependency (rbush for spatial indexing). Framework wrappers are thin bindings with zero additional dependencies.

What you get

The parser handles 13 entity types and auto-detects encoding (UTF-8, Shift-JIS, GBK, EUC-KR, Big5). Parsing runs in a Web Worker so the main thread stays free.

Rendering is Canvas 2D with path batching, viewport culling, and sub-pixel optimization. Two built-in themes (dark and light) with a color resolution chain: entity β†’ layer β†’ default.

The viewer gives you pan, zoom, select, and measure tools out of the box. Touch works too β€” pinch-to-zoom, the whole thing. Layers can be toggled on/off or have their colors overridden.

DWG files are supported through @cadview/dwg, which lazy-loads a ~6Β MB WASM binary at runtime. It’s a separate package because the license is GPL-3.0.