Skip to main content
Built-in Elements

<schematicbox />

Overview

<schematicbox /> has three common uses:

  • Draw a fixed-size box at a schematic position.
  • Draw an automatically sized box around selected ports.
  • Show a selected set of pins from one <chip />, including on a different schematic sheet.

Use a Box Without chipRef

Without chipRef, <schematicbox /> is a visual annotation. It creates a schematic box and optional title, but it does not create a component or any ports.

Choose exactly one sizing mode:

  • Pass width and height for a fixed-size box.
  • Pass a non-empty overlay array to calculate the box from existing ports.

Do not pass width or height together with overlay.

Size a Box from Selected Ports

Use overlay with port selectors to size a box around existing schematic ports. The selectors can reference ports from one or more components. After schematic layout, the box finds the outermost selected port positions and adds the configured padding.

padding applies to every side. Use paddingTop, paddingBottom, paddingLeft, or paddingRight to override individual sides. For an overlay box, schX and schY offset the calculated box position.

const selectedPortSelectors = [
".U1 > .pin5",
".U1 > .pin6",
".U2 > .pin1",
".U2 > .pin2",
]

export default () => (
<board width="10mm" height="10mm" routingDisabled>
<chip name="U1" footprint="soic8" />
<chip name="U2" footprint="soic8" schX={2} />
<schematicbox
title="Selected U1 and U2 ports"
titleAlignment="top_left"
strokeStyle="dashed"
overlay={selectedPortSelectors}
padding={0.2}
/>
</board>
)
Schematic Circuit Preview

Show Part of a Chip

Set chipRef to a chip selector, then pass only the pinLabels that should be shown by that box. The box creates a separate schematic representation of the same component; it does not create another physical chip.

const chipSelector = ".U1"
const powerPinLabels = {
pin1: "VCC",
pin2: "GND",
}

<schematicbox
name="U1A"
chipRef={chipSelector}
width={2.245}
height={1}
pinLabels={powerPinLabels}
schPinArrangement={{
leftSide: ["pin1", "pin2"],
rightSide: [],
}}
/>

Place a box inside each <schematicsheet /> where the selected pins should appear. Connections continue to use the source component name and label, such as U1.VCC.

For a complete example, see Split a Component Across Schematic Sheets.

Props

PropTypeRequiredDescription
namestringNoName for the box or chip section.
chipRefstringNoSelector for the source chip represented by this box.
pinLabelsPinLabelsPropNoLocal pin positions mapped to labels from the referenced chip.
schPinArrangementSchematicPinArrangementNoPlaces the box's local pins on its sides.
schXdistanceNoX position of a fixed-size box.
schYdistanceNoY position of a fixed-size box.
widthdistanceConditionalBox width. Provide it together with height, or use overlay.
heightdistanceConditionalBox height. Provide it together with width, or use overlay.
overlaystring[]ConditionalPort selectors used to calculate the box bounds. Do not combine with width and height.
paddingdistanceNoPadding on every side of an overlay box.
paddingLeftdistanceNoLeft padding for an overlay box.
paddingRightdistanceNoRight padding for an overlay box.
paddingTopdistanceNoTop padding for an overlay box.
paddingBottomdistanceNoBottom padding for an overlay box.
titlestringNoText displayed with the box.
titleAlignmentninePointAnchorNoPosition of the title relative to the box.
titleColorstringNoTitle text color.
titleFontSizedistanceNoTitle font size.
titleInsidebooleanNoPlaces the title inside the box when true.
strokeStyle"solid" | "dashed"NoBox outline style.