Skip to main content
Built-in Elements

<schematicrect />

Overview

The <schematicrect /> element is a primitive drawing component used within <symbol /> to create rectangular shapes in custom schematic representations. It's useful for creating box outlines, filled backgrounds, or any rectangular visual elements in your component symbols.

note

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

Basic Rectangle

Here's a simple example of a chip with a rectangular symbol:

export default () => (
<board width="10mm" height="10mm">
<chip
name="U1"
symbol={
<symbol>
<schematicrect
schX={0}
schY={0}
width={2}
height={1.5}
isFilled={false}
/>
<port name="pin1" direction="left" schX={-1} schY={0} />
<port name="pin2" direction="right" schX={1} schY={0} />
</symbol>
}
/>
</board>
)
Schematic Circuit Preview

Filled Rectangle

You can create filled rectangles with custom colors:

export default () => (
<board width="10mm" height="10mm">
<chip
name="U1"
symbol={
<symbol>
<schematicrect
schX={0}
schY={0}
width={2.5}
height={1.8}
isFilled={true}
fillColor="#e0f0ff"
color="#0066cc"
strokeWidth={0.05}
/>
<port name="in" direction="left" schX={-1.25} schY={0} />
<port name="out" direction="right" schX={1.25} schY={0} />
</symbol>
}
/>
</board>
)
Schematic Circuit Preview

Rotated Rectangle

Rectangles can be rotated to create angled elements:

export default () => (
<board width="10mm" height="10mm">
<chip
name="U1"
symbol={
<symbol>
<schematicrect
schX={0}
schY={0}
width={2}
height={0.5}
rotation={45}
isFilled={false}
strokeWidth={0.04}
/>
<port name="pin1" direction="left" schX={-1} schY={0} />
<port name="pin2" direction="right" schX={1} schY={0} />
</symbol>
}
/>
</board>
)
Schematic Circuit Preview

Props

PropertyTypeRequiredDefaultDescription
schXdistanceNo-X position of the rectangle center in schematic coordinates
schYdistanceNo-Y position of the rectangle center in schematic coordinates
widthdistanceYes-Width of the rectangle
heightdistanceYes-Height of the rectangle
rotationrotationNo0Rotation angle of the rectangle in degrees
strokeWidthdistanceNo-Width of the rectangle outline stroke
colorstringNo"#000000"Color of the rectangle outline
isFilledbooleanNofalseWhether the rectangle is filled with color
fillColorstringNo-Fill color of the rectangle (only applies when isFilled is true)