A <component /> can be used to construct custom components with user-defined ports, footprints, and schematic symbols.

Example Usage

ExampleCustomComponent.tsx
const Circuit = () => (
  <component name="K">
    <schematicbox x={0} y={0} width="5mm" height="5mm" />
    <schematictext x={0} y={0} text="Complex Component" />
    <schematicline x1={-0.1} y1={1} x2={0.1} y2={1} />
    <schematicpath
      points={[
        {
          x: "0.5mm",
          y: "1.5mm",
        },
        {
          x: "1mm",
          y: "1.5mm",
        },
        {
          x: 1,
          y: 2,
        },
      ]}
      is_filled
    />
    <port name="v1" x="2.5mm" y="-1mm" dir="right" />
    <port name="v2" x="2.5mm" y="0mm" dir="right" />
    <port name="gnd" x="2.5mm" y="1mm" dir="right" />
    <platedhole x={0} y={0} hole_diameter="1mm" outer_diameter="2mm" />
    <platedhole x="3mm" y={0} hole_diameter="1mm" outer_diameter="2mm" />
    <smtpad x="6mm" y={0} width="3mm" height="3mm" shape="rect" />
  </component>
)