GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tscircuit/core: Create electronics with Typescript and React. Compile Typescript to Circuit JSON

BranchesTags
Open more actions menu

Latest commit

 

History

5,614 Commits
5,614 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
benchmarking
benchmarking
 
 
docs
docs
 
 
lib
lib
 
 
proposals
proposals
 
 
scripts
scripts
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
CLAUDE.md
CLAUDE.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
biome.json
biome.json
 
 
bunfig.toml
bunfig.toml
 
 
index.ts
index.ts
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
tsup.config.ts
tsup.config.ts
 
 
vercel.json
vercel.json
 
 

Repository files navigation

@tscircuit/core

The core logic used to build Circuit JSON from tscircuit React elements.

tscircuit · Online Playground · Development Guide · Core Benchmarks · Contributor Getting Started Video

You can use core to create Circuit JSON, which can then be converted into Gerbers, viewed online, and much more.

Usage

import { Circuit } from "@tscircuit/core"

const circuit = new Circuit()

circuit.add(
  <board width="10mm" height="10mm">
    <resistor name="R1" resistance="10k" footprint="0402" />
    <led name="L1" footprint="0402" />

    <trace from="R1.pin1" to="net.VCC" />
    <trace from="R1.pin2" to="L1.pos" />
    <trace from="L1.neg" to="net.GND" />
  </board>
)

circuit.getCircuitJson()

System block diagrams

For high-level functional diagrams, use the systemblock namespace. Core automatically resolves block positions, sizes, routes, and label anchors into Circuit JSON, ready for convertCircuitJsonToSystemSvg from circuit-to-svg.

Non-React Usage

import { Board, Resistor, Led, Trace, Circuit } from "@tscircuit/core"

const circuit = new Circuit()

const board = new Board({
  width: "10mm",
  height: "10mm",
})
circuit.add(board)

const R1 = new Resistor({ resistance: "10k", footprint: "0402" })
const L1 = new Led({ footprint: "0402" })
board.add(R1)
board.add(L1)

const trace = new Trace({ width: "0.2mm" })
trace.connect(R1.output, L1.anode)
board.add(trace)

circuit.getCircuitJson() // [{ type: "board", ...}, { type: "resistor", ...}, ...]

Development

  • Declare PCB return-current experiments in TSX

  • How does core work?

  • How to do benchmarking or debug performance

About

Create electronics with Typescript and React. Compile Typescript to Circuit JSON

tscircuit.com

Topics

electronicselectronics-as-codeelectronics-engineeringhacktoberfestkicadkicad-pcb

Resources

Readme
MIT license
Activity
Custom properties

Stars

61 stars

Watchers

2 watching

Forks

256 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.