Skip to main content
Built-in Elements

<connector />

Overview

A <connector /> represents a physical connector on your board, such as a USB receptacle, wire terminal, or board-to-board header. It behaves similarly to <chip /> for placement and footprint handling, but is specialized for connector use cases.

Connectors support:

  • Custom pin naming via pinLabels
  • Explicit internal shorting via internallyConnectedPins
  • Schematic pin styling and arrangement controls
  • Optional connector standard hints for USB-C, M.2, and common JST families

Standard Connector Examples

USB-C

export default () => (
<board width="30mm" height="20mm">
<connector name="J_USB" standard="usb_c" />
</board>
)
Schematic Circuit Preview

JST connectors

For a JST connector, set standard to the connector family and pinCount to the number of electrical circuits. When you do not provide a footprint, the parts engine uses both values to select a compatible part.

export default () => (
<board width="30mm" height="20mm">
<connector name="J1" standard="jst_ph" pinCount={2} />
</board>
)
Schematic Circuit Preview

The supported JST families are:

standard valueJST familyNominal pitch
"jst_sh"SH1.0 mm
"jst_gh"GH1.25 mm
"jst_zh"ZH1.5 mm
"jst_ph"PH2.0 mm
"jst_xh"XH2.5 mm
"jst_vh"VH3.96 mm

The family determines the pitch, so use the exact family-only value. For example, "jst_sh_2mm" is invalid. pinCount must be a positive integer. To select a specific connector instead of allowing automatic part selection, set manufacturerPartNumber or provide an explicit footprint; an explicit footprint takes priority over standard-based selection.

Custom Footprint Example

export default () => (
<board width="40mm" height="40mm">
<connector
name="J1"
manufacturerPartNumber="AF_QTZB1_0"
pinLabels={{
pin1: ["VCC"],
pin2: ["D_NEG"],
pin3: ["D_POS"],
pin4: ["GND"],
pin5: ["EH1"],
pin6: ["EH2"],
}}
footprint={
<footprint>
<hole pcbX="-2.5mm" pcbY="-2.125mm" diameter="1.3mm" />
<hole pcbX="2.5mm" pcbY="-2.125mm" diameter="1.3mm" />
<smtpad
portHints={["pin1"]}
pcbX="-3.5mm"
pcbY="1.575mm"
width="1.1mm"
height="3.8mm"
shape="rect"
/>
<smtpad
portHints={["pin2"]}
pcbX="-1mm"
pcbY="1.575mm"
width="1.1mm"
height="3.8mm"
shape="rect"
/>
<smtpad
portHints={["pin3"]}
pcbX="1mm"
pcbY="1.575mm"
width="1.1mm"
height="3.8mm"
shape="rect"
/>
<smtpad
portHints={["pin4"]}
pcbX="3.5mm"
pcbY="1.575mm"
width="1.1mm"
height="3.8mm"
shape="rect"
/>
<smtpad
portHints={["pin5"]}
pcbX="7.15mm"
pcbY="-1.475mm"
width="1.8mm"
height="4mm"
shape="rect"
/>
<smtpad
portHints={["pin6"]}
pcbX="-7.15mm"
pcbY="-1.475mm"
width="1.8mm"
height="4mm"
shape="rect"
/>
</footprint>
}
/>
</board>
)
PCB Circuit Preview

This example is adapted from the core test for connector cable insertion center behavior: connector-cable-insertion-center.test.tsx.

Cable insertion center

When a connector footprint is rendered, tscircuit computes pcb_component.cable_insertion_center for the connector in circuit JSON. This gives a useful reference point for cable entry direction, annotation, or automation workflows.

In the linked test, the computed cable insertion center is validated and then visualized as a small PCB note rectangle.

Properties

The TypeScript interface for <connector /> is defined in @tscircuit/props:

export interface ConnectorProps extends CommonComponentProps {
manufacturerPartNumber?: string
pinLabels?: Record<
number | SchematicPinLabel,
SchematicPinLabel | SchematicPinLabel[]
>
schPinStyle?: SchematicPinStyle
schPinSpacing?: number | string
schWidth?: number | string
schHeight?: number | string
schDirection?: "left" | "right"
schPortArrangement?: SchematicPortArrangement
internallyConnectedPins?: (string | number)[][]
standard?:
| "usb_c"
| "m2"
| "jst_sh"
| "jst_gh"
| "jst_zh"
| "jst_ph"
| "jst_xh"
| "jst_vh"
pinCount?: number
}
PropertyTypeDescription
manufacturerPartNumberstringManufacturer part number for the connector.
pinLabelsRecord<number | SchematicPinLabel, SchematicPinLabel | SchematicPinLabel[]>Maps connector pins to one or more net labels.
schPinStyleSchematicPinStyleSchematic rendering style for pins.
schPinSpacingnumber | stringPin spacing in schematic symbol.
schWidthnumber | stringSchematic symbol width.
schHeightnumber | stringSchematic symbol height.
schDirection"left" | "right"Direction of the connector symbol pins.
schPortArrangementSchematicPortArrangementSchematic port layout strategy.
internallyConnectedPins(string | number)[][]Pin groups treated as internally shorted.
standardConnectorStandardConnector interface or product family. See the supported values above.
pinCountnumberNumber of electrical circuits. Must be a positive integer.

Like most components, <connector /> also accepts common placement and PCB props from CommonComponentProps such as pcbX, pcbY, rotation, and footprint.