Skip to main content
Built-in Elements

<courtyardrect />

Overview

Use <courtyardrect /> to create rectangular courtyard boundaries for packages with rectangular bodies.

Basic Example

export default () => (
<board width="26mm" height="20mm">
<chip
name="U1"
footprint={
<footprint>
<platedhole shape="circle" pcbX={-4} pcbY={0} outerDiameter={2.2} holeDiameter={1.1} />
<platedhole shape="circle" pcbX={4} pcbY={0} outerDiameter={2.2} holeDiameter={1.1} />
<courtyardrect
pcbX={0}
pcbY={0}
width={12}
height={8}
strokeWidth={0.1}
/>
</footprint>
}
/>
</board>
)
PCB Circuit Preview

Dashed Courtyard Example

export default () => (
<board width="30mm" height="24mm">
<chip
name="J1"
footprint={
<footprint>
<platedhole shape="circle" pcbX={-3} pcbY={0} outerDiameter={2.2} holeDiameter={1.1} />
<platedhole shape="circle" pcbX={3} pcbY={0} outerDiameter={2.2} holeDiameter={1.1} />
<courtyardrect
pcbX={0}
pcbY={0}
width={14}
height={10}
strokeWidth={0.1}
isStrokeDashed
/>
</footprint>
}
/>
</board>
)
PCB Circuit Preview

Anchor Alignment Examples

The board's anchorAlignment property controls which point on the board is used as the origin for positioning. This affects where courtyard rects appear relative to the board.

Center Anchor (Default)

export default () => (
<board width="30mm" height="24mm" anchorAlignment="center">
<chip
name="U1"
pcbX={0}
pcbY={0}
footprint={
<footprint>
<smtpad shape="rect" width={1.2} height={2} pcbX={-2.5} pcbY={0} portHints={["1"]} />
<smtpad shape="rect" width={1.2} height={2} pcbX={2.5} pcbY={0} portHints={["2"]} />
<courtyardrect pcbX={0} pcbY={0} width={8} height={5} strokeWidth={0.1} />
</footprint>
}
/>
</board>
)
PCB Circuit Preview

Top-Left Anchor

export default () => (
<board width="30mm" height="24mm" anchorAlignment="top_left">
<chip
name="U1"
pcbX={15}
pcbY={12}
footprint={
<footprint>
<smtpad shape="rect" width={1.2} height={2} pcbX={-2.5} pcbY={0} portHints={["1"]} />
<smtpad shape="rect" width={1.2} height={2} pcbX={2.5} pcbY={0} portHints={["2"]} />
<courtyardrect pcbX={0} pcbY={0} width={8} height={5} strokeWidth={0.1} />
</footprint>
}
/>
</board>
)
PCB Circuit Preview

Bottom-Right Anchor

export default () => (
<board width="30mm" height="24mm" anchorAlignment="bottom_right">
<chip
name="U1"
pcbX={-15}
pcbY={-12}
footprint={
<footprint>
<smtpad shape="rect" width={1.2} height={2} pcbX={-2.5} pcbY={0} portHints={["1"]} />
<smtpad shape="rect" width={1.2} height={2} pcbX={2.5} pcbY={0} portHints={["2"]} />
<courtyardrect pcbX={0} pcbY={0} width={8} height={5} strokeWidth={0.1} />
</footprint>
}
/>
</board>
)
PCB Circuit Preview