
tscircuit Core
https://github.com/tscircuit/core- Category
- Developer Tools
- Rank
- No. 890Tools index
Previous survey · No. 895 ·
- Pricing
- Open Source
- Type
- TOOL
- Builder
- tscircuit
- GitHub
- 58 stars
- Date
About
Create electronics with TypeScript and React — compiles TS to Circuit JSON.
What it does
It turns an electronics component tree into a structured circuit database. Authors can describe boards, parts, nets, and traces with React elements or construct the same model directly with classes, then retrieve Circuit JSON for downstream tools.
Why it's ranked here
This is a substantial core library, not a thin syntax wrapper. It manages rendering, asynchronous effects, subcircuit caching, component registration, selection, layout, schematic routing, autorouting, copper pours, and enclosure generation. Its narrow ecosystem focus and large peer dependency surface temper that strength.
What's good
The dual React and class-based authoring styles suit different TypeScript workflows. Rendering can wait for asynchronous work to settle, while repeated subcircuits share cached results and pending renders. Platform settings can disable schematics, PCB generation, or routing, and typed selectors cover common references, pins, and nets.
Tradeoffs
The package expects many peer dependencies from the surrounding tscircuit ecosystem, which raises integration and version-management costs. SVG rendering needs another package. Preview support explicitly throws an unimplemented error. The root circuit and ordinary circuit currently share one implementation, with their future distinction left unresolved.
How to use it well
Use it when a TypeScript application needs a programmable source model for electronics and Circuit JSON as the interchange boundary. Choose React elements for declarative composition or classes for direct construction. Pair it with downstream viewers, Gerber converters, or SVG tooling, because manufacturing output and visualization are not its central job.
Technical notes+
package.json defines an ESM-only package whose published surface contains dist, with JavaScript and declaration entry points. lib/index.ts re-exports components, hooks, selectors, autorouting utilities, edit-event utilities, events, render internals, and solvers. lib/RootCircuit.ts aliases Circuit to RootCircuit and retains Project as deprecated. lib/IsolatedCircuit.ts stores Circuit JSON through circuit-json utilities, renders component trees, tracks asynchronous effects by phase, caches isolated subcircuits, emits completion events, and dynamically imports circuit-to-svg for SVG output. Its preview method is explicitly unimplemented. lib/solvers.ts exposes packing, layout, autorouting, copper-pour, enclosure, and schematic-routing solvers. lib/register-catalogue.ts automatically registers exported components and adds named aliases.
Observed
- Primary language
- TypeScript, including TSX examples and typed public interfaces.
- Packaging
- ES module package named @tscircuit/core; published files are limited to the dist directory.
- Interface
- Library API with both React-element and direct class-based circuit construction.
- Output
- Produces Circuit JSON arrays for use by downstream electronics tools.
- Type surface
- Ships generated TypeScript declarations alongside its JavaScript entry point.
- Rendering model
- Supports synchronous rendering and asynchronous rendering that waits until registered effects settle.
- Solver surface
- Exports packing, layout, autorouting, copper-pour, enclosure, and schematic-routing solvers.
- Dependency model
- Uses numerous tscircuit packages and TypeScript as peer dependencies.
Read from README.md, package.json, index.ts, lib/index.ts, lib/solvers.ts, lib/RootCircuit.ts, lib/IRootCircuit.ts, lib/IsolatedCircuit.ts, lib/IIsolatedCircuit.ts, lib/local-cache-engine.ts, lib/register-catalogue.ts, lib/static-asset-imports.d.ts, lib/sel/sel.ts, lib/sel/index.ts, lib/utils/pairs.ts.
What it can do
Compile TypeScript code to Circuit JSON
TypeScript code defining electronic circuits → Circuit JSON representation
Convert React components to electronic circuit definitions
React components describing circuit elements → Electronic circuit schematics
Generate PCB layouts from code
TypeScript/React circuit definitions → PCB (Printed Circuit Board) layout files
Create electronic component libraries
TypeScript component definitions → Reusable electronic component libraries
Validate circuit designs programmatically
Circuit definitions in TypeScript → Circuit validation results and error reports
Export circuits to manufacturing formats
Circuit JSON definitions → Manufacturing-ready files (Gerber, drill files, etc.)
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.