Configuring Chips
The <chip />
is the most common and most powerful built-in tscircuit element.
You can represent virtually any "single-part" electronic component with <chip />
,
it is extremely flexible.
Simple Chips
Here's an example of typical <chip />
usage. We specify a footprint string and
the pin labels that should be used for the schematic representation.
import type { CommonLayoutProps } from "tscircuit"
interface Props extends CommonLayoutProps {
name: string
}
export const A555Timer = (props: Props) => {
return (
<chip
footprint="soic8"
pinLabels={{
pin1: "VCC",
pin2: "DISCH",
pin3: "THRES",
pin4: "CTRL",
pin5: "GND",
pin6: "TRIG",
pin7: "OUT",
pin8: "RESET"
}}
{...props}
/>
)
}
Customizing the Schematic Representation
You can alter how a chip appears on the schematic by using the schPinArrangement
, schPinStyles
and schWidth
properties.
schPinArrangement
schPinArrangement
controls the arrangement of the pins on the schematic box
representing the chip. You can use this to group similar pins together e.g. to
group GPIO pins together.
schPortArrangement
was renamed to schPinArrangement
in 2025.
export default () => (
<board width="10mm" height="10mm">
<chip
name="U1"
footprint="soic8"
schPortArrangement={{
leftSide: {
direction: "top-to-bottom",
pins: ["VCC", "DISCH", "THRES", "CTRL"],
},
rightSide: {
direction: "bottom-to-top",
pins: ["GND", "TRIG", "OUT", "RESET"],
},
}}
pinLabels={{
pin1: "VCC",
pin2: "DISCH",
pin3: "THRES",
pin4: "CTRL",
pin5: "GND",
pin6: "TRIG",
pin7: "OUT",
pin8: "RESET"
}}
/>
</board>
)
You can also place pins on the top or bottom of the schematic box.
export default () => (
<board width="10mm" height="10mm">
<chip
name="U1"
footprint="soic8"
schPortArrangement={{
topSide: {
direction: "left-to-right",
pins: ["VCC"],
},
bottomSide: {
direction: "left-to-right",
pins: ["GND"],
},
leftSide: {
direction: "top-to-bottom",
pins: ["DISCH", "THRES", "CTRL"],
},
rightSide: {
direction: "bottom-to-top",
pins: ["TRIG", "OUT", "RESET"],
},
}}
pinLabels={{
pin1: "VCC",
pin2: "DISCH",
pin3: "THRES",
pin4: "CTRL",
pin5: "GND",
pin6: "TRIG",
pin7: "OUT",
pin8: "RESET"
}}
/>
</board>
)
schPinStyles
schPinStyles
controls the style of the pins on the schematic box
export default () => (
<board width="10mm" height="10mm">
<chip
name="U1"
footprint="soic8"
schPinArrangement={{
topSide: {
direction: "left-to-right",
pins: ["VCC"],
},
bottomSide: {
direction: "left-to-right",
pins: ["GND"],
},
leftSide: {
direction: "top-to-bottom",
pins: ["DISCH", "THRES", "CTRL"],
},
rightSide: {
direction: "bottom-to-top",
pins: ["TRIG", "OUT", "RESET"],
},
}}
schPinStyle={{
pin1: {
bottomMargin: 0.2
},
GND: {
rightMargin: "0.5mm"
},
THRES: {
topMargin: 0.5
},
OUT: {
topMargin: 1,
bottomMargin: "1mm"
}
}}
// This is the future syntax for schPinStyle!
// schPinStyle={{
// pin1: {
// marginBottom: 0.2,
// },
// GND: { marginRight: "0.5mm" },
// THRES: { marginTop: 0.5 },
// OUT: {
// marginTop: 1,
// marginBottom: "1mm",
// },
// }}
pinLabels={{
pin1: "VCC",
pin2: "DISCH",
pin3: "THRES",
pin4: "CTRL",
pin5: "GND",
pin6: "TRIG",
pin7: "OUT",
pin8: "RESET",
}}
/>
</board>
)
Custom Footprints
Often you will have a chip that you want to carefully specify the position of
each pad, plated hole, silkscreen line or other PCB element. To do this, just
insert a <footprint />
component instead of string for the footprint
prop.
Here's an example of a chip with a custom footprint:
export default () => (
<board width="10mm" height="10mm">
<chip
name="U1"
footprint={
<footprint>
<platedhole
portHints={["4"]}
pcbX="3.2499299999998357mm"
pcbY="-2.249932000000058mm"
outerDiameter="1.9999959999999999mm"
holeDiameter="1.3000228mm"
shape="circle"
/>
<platedhole
portHints={["2"]}
pcbX="3.2499299999998357mm"
pcbY="2.249932000000058mm"
outerDiameter="1.9999959999999999mm"
holeDiameter="1.3000228mm"
shape="circle"
/>
<platedhole
portHints={["1"]}
pcbX="-3.2499299999999494mm"
pcbY="2.249932000000058mm"
outerDiameter="1.9999959999999999mm"
holeDiameter="1.3000228mm"
shape="circle"
/>
<platedhole
portHints={["3"]}
pcbX="-3.2499299999999494mm"
pcbY="-2.249932000000058mm"
outerDiameter="1.9999959999999999mm"
holeDiameter="1.3000228mm"
shape="circle"
/>
<silkscreenpath
route={[
{ x: -2.2743160000001126, y: -2.999994000000015 },
{ x: 2.274315999999999, y: -2.999994000000015 },
]}
/>
<silkscreenpath
route={[
{ x: -2.999994000000129, y: 1.0999978000000965 },
{ x: -2.999994000000129, y: -0.999998000000005 },
]}
/>
<silkscreenpath
route={[
{ x: 3.0999937999998792, y: 1.0279888000000028 },
{ x: 3.0999937999998792, y: -1.0999977999999828 },
]}
/>
<silkscreenpath
route={[
{ x: -1.99999600000001, y: 2.999994000000015 },
{ x: 2.274315999999999, y: 2.999994000000015 },
]}
/>
</footprint>
}
schPortArrangement={{
leftSide: {
direction: "top-to-bottom",
pins: [1, 3],
},
rightSide: {
direction: "bottom-to-top",
pins: [4, 2],
},
}}
/>
</board>
)
For more information about custom footprints, check out the
Internally Connected Pins
Some chips, such as a standard 4 pin pushbutton, have pins that are internally connected. This can be useful to represent for simulation or to enable omitting pins from a schematic.
export default () => (
<board width="10mm" height="10mm">
<chip
name="U1"
footprint="pushbutton"
internallyConnectedPins={[
["pin1", "pin4"],
["pin2", "pin3"]
]}
/>
</board>
)
You may not want to do this for power or ground pins on boards where you're
expected to connect the pins specifically externally. For example, if you have
several V5 pins that each need a decoupling capacitor, it would be better to
manage the connections explicitly with traces (perhaps using maxTraceLength
!)
even if they are internally connected.
Externally Connected Pins
To indicate that pins should be externally connected, you can use the externallyConnectedPins
props.
Just like the internallyConnectedPins
prop, this is an array of arrays of pin labels, where each
sub-array represents a group of pins that should be connected together.
export default () => (
<board width="10mm" height="10mm">
<chip
name="U1"
footprint="soic8"
pinLabels={{
pin1: "VCC",
pin2: "DISCH",
pin3: "THRES",
pin4: "CTRL",
pin5: "GND",
pin6: "TRIG",
pin7: "OUT",
pin8: "RESET"
}}
externallyConnectedPins={[
["GND", "DISCH"],
["TRIG", "VCC"]
]}
/>
</board>
)
Specifying the Manufacturer Part Number or Supplier Part Numbers
tscircuit will attempt to find matching parts based on the manufacturerPartNumber
and footprint
that was provided. If you know the exact part from your supplier
you'd like to use, you should set the supplierPartNumbers
property as shown
below:
import { createUseComponent } from "@tscircuit/core"
import type { CommonLayoutProps } from "@tscircuit/props"
interface Props extends CommonLayoutProps {
name: string
}
export const Diode1N4148WS = (props: Props) => {
return (
<diode
{...props}
supplierPartNumbers={{
jlcpcb: ["C57759"]
}}
footprint={
<footprint>
<smtpad
portHints={["1"]}
pcbX="-1.1725910000000113mm"
pcbY="0mm"
width="0.9999979999999999mm"
height="0.7500112mm"
shape="rect"
/>
<smtpad
portHints={["2"]}
pcbX="1.1725910000000113mm"
pcbY="0mm"
width="0.9999979999999999mm"
height="0.7500112mm"
shape="rect"
/>
<silkscreenpath
route={[
{ x: 0.9012427999999773, y: -0.726211400000011 },
{ x: 0.9012427999999773, y: -0.5199887999999646 },
]}
/>
<silkscreenpath
route={[
{ x: 0.9012427999999773, y: 0.726211400000011 },
{ x: 0.9012427999999773, y: 0.5299964000000728 },
]}
/>
<silkscreenpath
route={[
{ x: -0.8512047999998913, y: 0.726211400000011 },
{ x: 0.9012427999999773, y: 0.726211400000011 },
]}
/>
<silkscreenpath
route={[
{ x: -0.8512047999998913, y: -0.726211400000011 },
{ x: 0.9012427999999773, y: -0.726211400000011 },
]}
/>
<silkscreenpath
route={[
{ x: -0.44676059999994777, y: 0.726211400000011 },
{ x: -0.44676059999994777, y: -0.726211400000011 },
]}
/>
</footprint>
}
cadModel={{
objUrl:
"https://modelcdn.tscircuit.com/easyeda_models/download?uuid=973acf8a660c48b1975f1ba1c890421a&pn=C57759",
rotationOffset: { x: 0, y: 0, z: 0 },
positionOffset: { x: 0, y: 0, z: 0 },
}}
schPinSpacing={0.75}
schPortArrangement={{
leftSide: {
direction: "top-to-bottom",
pins: [1],
},
rightSide: {
direction: "bottom-to-top",
pins: [2],
},
}}
/>
)
}
If you don't specify supplierPartNumbers
, tscircuit will automatically scan
for in-stock parts and select a chip using vendor APIs in the Cloud API using
the platform parts engine
Supported Suppliers
The following are the supported supplier keys. The list is maintained here and you can request additional suppliers by creating an issue
Available supplier keys:
- jlcpcb
- digikey
- mouser
- macrofab
- pcbway
- lcsc
You can also insert custom keys for your organization and they will be copied to the output Circuit JSON
Type-safe Chips: Custom Component Hooks
Component hooks are a great way to improve type safety and simplify the usage
of your component. A component hook is created with the createUseComponent
from tscircuit
and returns a hook that when used, will generate a component
with properties for each pin label.
import { createUseComponent, type CommonLayoutProps } from "tscircuit"
interface Props extends CommonLayoutProps {
name: string
}
const pinLabels = {
pin1: "VCC",
pin2: "DISCH",
pin3: "THRES",
pin4: "CTRL",
pin5: "GND",
pin6: "TRIG",
pin7: "OUT",
pin8: "RESET"
} as const
export const A555Timer = (props: Props) => (
<chip
footprint="soic8"
pinLabels={pinLabels}
{...props}
/>
)
export const use555Timer = createUseComponent(A555Timer, pinLabels)
Make sure to have as const
when you're defining your pinLabels
, if you're
missing this the types won't work!
When you use Component Hooks, you get better type checking in your component usage because all the pin labels are now available on the component!
import { use555Timer } from "./a555timer"
import { usePowerRegulator } from "./power-regulator"
export default () => {
const U1 = use555Timer("U1")
const M1 = usePowerRegulator("M1")
return (
<board width="10mm" height="10mm">
<U1 />
<M1 />
<trace from={U1.GND} to="net.GND" />
<trace from={U1.VCC} to={M1.V5} />
</board>
)
}
Importing Chips from JLCPCB, KiCad or Circuit JSON
There are a lot of ways to import a chip configuration, each with their own guide! This is often much easier and reliable than configuring a chip yourself.