Skip to main content
Built-in Elements

<port />

Overview

The <port /> element defines connection points within a <symbol />. Ports specify where traces connect to your component in the schematic view.

note

<port /> can only be used inside a <symbol /> element.

Basic Usage

export default () => (
<board width="10mm" height="10mm">
<chip
name="D1"
symbol={
<symbol>
{/* Diode triangle */}
<schematicline x1={-0.3} y1={-0.4} x2={-0.3} y2={0.4} strokeWidth={0.05} />
<schematicline x1={-0.3} y1={0.4} x2={0.3} y2={0} strokeWidth={0.05} />
<schematicline x1={0.3} y1={0} x2={-0.3} y2={-0.4} strokeWidth={0.05} />
{/* Cathode bar */}
<schematicline x1={0.3} y1={-0.4} x2={0.3} y2={0.4} strokeWidth={0.05} />
{/* Ports */}
<port name="A" schX={-0.3} schY={0} direction="left" />
<port name="K" schX={0.3} schY={0} direction="right" />
</symbol>
}
/>
</board>
)
Schematic Circuit Preview

Props

PropertyTypeRequiredDefaultDescription
namestringYes-Port identifier used for connections
schXnumberYes-X position in schematic units
schYnumberYes-Y position in schematic units
direction"left" | "right" | "up" | "down"No-Direction the port faces
schStemLengthnumberNo-Length of the stem line extending from the port

Custom Stem Length

Use schStemLength to control how far the connection stem extends from the port:

export default () => (
<board width="10mm" height="10mm">
<chip
name="U1"
symbol={
<symbol>
{/* Op-amp triangle */}
<schematicline x1={-0.5} y1={-0.7} x2={-0.5} y2={0.7} strokeWidth={0.05} />
<schematicline x1={-0.5} y1={0.7} x2={0.7} y2={0} strokeWidth={0.05} />
<schematicline x1={0.7} y1={0} x2={-0.5} y2={-0.7} strokeWidth={0.05} />
{/* Plus/minus labels */}
<schematictext schX={-0.35} schY={0.35} text="+" fontSize={0.3} />
<schematictext schX={-0.35} schY={-0.35} text="-" fontSize={0.3} />
{/* Ports with custom stem lengths */}
<port name="IN+" schX={-1} schY={0.35} direction="left" schStemLength={0.5} />
<port name="IN-" schX={-1} schY={-0.35} direction="left" schStemLength={0.5} />
<port name="OUT" schX={1.1} schY={0} direction="right" schStemLength={0.4} />
</symbol>
}
/>
</board>
)
Schematic Circuit Preview