<board />
The <board /> element is a root element that contains all the chips and traces
to create a PCB.
You can think of a <board /> like a <body /> element in HTML. Everything
goes in a board!
export default () => (
<board width="10mm" height="10mm">
<resistor resistance="1k" footprint="0402" name="R1" />
</board>
)
Board Properties
| Prop | Type | Description |
|---|---|---|
width, height | string | number | Define the board's bounding box dimensions in millimeters. |
borderRadius | string | number | Round the corners of rectangular outlines by the specified radius. |
layers | 1 | 2 | 4 | 6 | 8 | Specify the number of copper layers in the board stackup. Defaults to 2 layers. |
autorouter | 'auto' | 'sequential-trace' | 'auto-local' | 'auto-cloud' | 'laser_prefab' | AutorouterConfig | Select a built-in autorouter preset or provide a configuration object. |
routingDisabled | boolean | Skip routing to speed up development. |
schematicDisabled | boolean | Skip schematic generation for boards that only need the PCB view. |
outline | Array<{ x: number, y: number }> | Supply a custom polygon to replace the default rectangular outline. |
outlineOffsetX, outlineOffsetY | string | number | Offset a custom outline relative to the bounding box origin. |
material | 'fr4' | 'fr1' | PCB substrate material. Defaults to 'fr4'. |
thickness | string | number | Board thickness in millimeters. |
title | string | Title for the board, displayed in documentation and exports. |
solderMaskColor | string | Color applied to both top and bottom solder masks. |
topSolderMaskColor | string | Color of the top solder mask. |
bottomSolderMaskColor | string | Color of the bottom solder mask. |
silkscreenColor | string | Color applied to both top and bottom silkscreens. |
topSilkscreenColor | string | Color of the top silkscreen. |
bottomSilkscreenColor | string | Color of the bottom silkscreen. |
doubleSidedAssembly | boolean | Whether the board should be assembled on both sides. Defaults to false. |
boardAnchorPosition | { x: number, y: number } | Moves the board's anchor point to the specified coordinates. |
boardAnchorAlignment | 'center' | 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right' | 'center_left' | 'center_right' | 'top_center' | 'bottom_center' | Sets which part of the board the anchor point refers to. |
defaultTraceWidth | string | number | Default width for traces within this board. |
minTraceWidth | string | number | Minimum allowed trace width for routing. |
Customizing the Size of the Board
Generally you'll use the width and height properties to define the size of
the board.
Disabling Routing with routingDisabled
The routingDisabled prop is a powerful development speed optimization. When working
on component placement and circuit design, autorouting can slow down your iteration
cycle. Set routingDisabled={true} to skip the routing step and see your changes
instantly:
<board width="20mm" height="20mm" routingDisabled>
<chip name="U1" footprint="soic8" pcbX={5} pcbY={0} />
<resistor name="R1" pcbX={-5} pcbY={0} resistance={100} footprint="0402" />
{/* Traces will show as unrouted ratsnest lines */}
<trace from=".U1 > .pin1" to=".R1 > .pin1" />
</board>
Why use routingDisabled?
- Faster development - Skip routing calculations during component placement
- Instant feedback - See layout changes immediately without waiting
- Focus on placement - Perfect for optimizing component positions before routing
- Better performance - Especially helpful with complex boards that have many traces
Simply remove routingDisabled or set it to false when you're ready to see the
final routed board. This workflow significantly speeds up the iterative design process.
Board Material and Colors
You can customize the appearance and manufacturing properties of your board:
Material Selection
Set the material prop to specify the PCB substrate:
"fr4"(default) - Standard fiberglass epoxy laminate"fr1"- Paper-based phenolic resin (lower cost)
Solder Mask Colors
Customize the solder mask appearance:
solderMaskColor- Sets both top and bottom mask colorstopSolderMaskColor- Sets only the top mask colorbottomSolderMaskColor- Sets only the bottom mask color
Common colors include: "green", "red", "blue", "purple", "black", "white", "yellow"
Silkscreen Colors
Control the silkscreen layer colors:
silkscreenColor- Sets both top and bottom silkscreen colorstopSilkscreenColor- Sets only the top silkscreen colorbottomSilkscreenColor- Sets only the bottom silkscreen color
Example with custom colors:
<board
width="30mm"
height="20mm"
material="fr4"
solderMaskColor="black"
silkscreenColor="white"
thickness="1.6mm"
>
<chip name="U1" footprint="qfn32" pcbX={0} pcbY={0} />
</board>
Double-Sided Assembly
For boards that require components on both sides, set doubleSidedAssembly={true}:
<board width="40mm" height="30mm" doubleSidedAssembly>
<chip name="U1" footprint="soic8" pcbX={0} pcbY={5} layer="top" />
<chip name="U2" footprint="soic8" pcbX={0} pcbY={-5} layer="bottom" />
</board>
This informs manufacturing that components will be placed on both the top and bottom layers of the board.
Rounding Board Corners with borderRadius
To soften sharp corners on a rectangular board, set the optional borderRadius
prop. You can pass the radius as either a number—interpreted in millimeters—or
as a string like "2mm". The radius is applied uniformly to all four corners.
export default () => (
<board width="20mm" height="15mm" borderRadius="3mm">
<chip name="U1" footprint="qfn32" pcbX={0} pcbY={0} />
<resistor name="R1" resistance="1k" footprint="0402" pcbX={5} pcbY={3} />
<resistor name="R2" resistance="10k" footprint="0402" pcbX={-5} pcbY={-3} />
</board>
)
Configuring the Layer Stack with layers
You can set the layers prop to add additional inner layers to your circuit
board. If you specify layers={4}, the "inner1" and "inner2" layers are
added automatically and available for routing, while omitting the prop keeps the
default two-layer stackup.
The following example enables a four-layer board and shows traces connecting components across that stackup:
export default () => (
<board
width="32mm"
height="20mm"
layers={4}
>
<chip name="U1" footprint="soic8" pcbX={-6} pcbY={0} />
<chip name="U2" footprint="soic8" pcbX={6} pcbY={0} rotation={180} />
<trace from=".U1 > .pin1" to=".U2 > .pin5" />
<trace from=".U1 > .pin2" to=".U2 > .pin6" />
<trace from=".U1 > .pin3" to=".U2 > .pin7" />
<trace from=".U1 > .pin4" to=".U2 > .pin8" />
</board>
)
Board Thickness
The board thickness can be specified using the thickness prop (e.g., thickness="1.6mm").
This is important for mechanical fit and impedance control considerations.
Controlling Trace Width
You can set default and minimum trace widths for all traces within a board:
defaultTraceWidth- Sets the default width for all traces (e.g.,"0.25mm")minTraceWidth- Sets the minimum allowed trace width during routing (e.g.,"0.15mm")
<board
width="30mm"
height="20mm"
defaultTraceWidth="0.3mm"
minTraceWidth="0.2mm"
>
<chip name="U1" footprint="soic8" pcbX={5} pcbY={0} />
<resistor name="R1" pcbX={-5} pcbY={0} resistance={100} footprint="0402" />
<trace from=".U1 > .pin1" to=".R1 > .pin1" />
</board>
These settings help ensure your traces meet manufacturing requirements and handle the expected current loads.
Setting the autorouter
Boards or subcircuits can specify what autorouter should be used to route any traces within them.
Usually you'll want to use an autorouter preset:
autorouter="auto"- Uses the platform configuration. For tscircuit.com this defaults tosequential-trace.autorouter="sequential-trace"- Iterate over each trace and use tscircuit's fast built-in autorouter. This method is fast and deterministic but often fails with over 50 traces.autorouter="auto-local"- Use the platform configuration, but only route locally (do not make API calls)autorouter="auto-cloud"- Use the platform configuration forautorouter="laser_prefab"- Reserve prefabricated vias that can be reassigned during routing. Ideal for rapid-turn PCBs produced with laser ablation and mechanical drilling templates. See the Biscuit Board Laser Ablation guide for a complete walkthrough.
For complex boards with over 50 traces, you should use autorouter="auto-cloud"
to take advantage of tscircuit's cloud autorouters, which internally use the popular
freerouting library.
You can also specify a custom autorouter object to use your own autorouter.
export default () => (
<board
width="20mm"
height="20mm"
autorouter={{
serverUrl: "https://registry-api.tscircuit.com",
serverMode: "job",
inputFormat: "simplified",
}}
>
<chip name="U1" footprint="soic8" pcbX={5} pcbY={0} />
<resistor
name="R1"
pcbX={-5}
pcbY={0}
resistance={100}
footprint="0402"
/>
<trace from=".U1 > .pin1" to=".R1 > .pin1" />
</board>
)
Learn more about the Autorouting API here
Set schematicDisabled when the schematic view would add clutter to the editor
or slow down complex mechanical assemblies. The prop is a simple boolean, so you
can add it without a value just like any other JSX attribute.
export default () => (
<board width="20mm" height="20mm" schematicDisabled>
<fabricationnotetext
name="Label"
text="PCB Fixture"
anchorAlignment="center"
pcbX={0}
pcbY={0}
/>
</board>
)
With schematicDisabled set, the schematic tab shows a placeholder instead of
attempting to lay out symbols or connections.
Custom Board Outlines
You can specify a custom outline for your board by passing an outline prop.
The PCB you get will have this outline cut out, this is great when you want a
board that's not a rectangle!
export default () => (
<board
outline={[
{ x: -22.5, y: 24.5 },
{ x: 22.5, y: 24.5 },
{ x: 22.5, y: 16.5 },
{ x: 20.5, y: 16.5 },
{ x: 20.5, y: 12.5 },
{ x: 22.5, y: 12.5 },
{ x: 22.5, y: 2.5 },
{ x: 18, y: -1.5 },
{ x: 18, y: -18 },
{ x: -18, y: -18 },
{ x: -18, y: -1.5 },
{ x: -22.5, y: 2.5 },
{ x: -22.5, y: 12.5 },
{ x: -20.5, y: 12.5 },
{ x: -20.5, y: 16.5 },
{ x: -22.5, y: 16.5 },
{ x: -22.5, y: 24.5 },
]}
/>
)
Offsetting the board origin
width and height set the board's bounding box (and thus the pcbX/pcbY
coordinate system) even when you're using a custom outline. Add
outlineOffsetX and outlineOffsetY—measured in millimeters, whether passed as
numbers or strings like "5mm"—to slide that outline relative to the bounding
box so (0, 0) lands where you expect. Positive offsets push the outline toward
increasing pcbX/pcbY coordinates.
In this example the outline is shifted half the board's width and height so the origin stays at the lower-left corner while the shape itself is centered:
export default () => (
<board
width="40mm"
height="30mm"
outlineOffsetX="20mm"
outlineOffsetY="15mm"
>
<chip name="U1" footprint="qfn32" pcbX={5} pcbY={5} />
<resistor name="R1" footprint="0402" resistance="1k" pcbX={10} pcbY={12} />
</board>
)
Board Anchor Properties
You can control the board's position and alignment using anchor properties:
boardAnchorPosition: Moves the board's anchor point to the specified coordinatesboardAnchorAlignment: Sets which part of the board the anchor point refers to
export default () => (
<board
width="10mm"
height="10mm"
boardAnchorPosition={{x:0, y:0}}
boardAnchorAlignment="bottom_left"
>
<resistor resistance="1k" footprint="0402" name="R1" pcbX={2} pcbY={2} />
<fabricationnotetext text="(5,5)" anchorAlignment="bottom_left" fontSize="0.5mm" pcbX={5} pcbY={5} />
<fabricationnotetext text="(10,10)" anchorAlignment="bottom_left" fontSize="0.5mm" pcbX={10} pcbY={10} />
<fabricationnotetext text="(0,0)" anchorAlignment="bottom_left" fontSize="0.5mm" pcbX={0} pcbY={0} />
</board>
)
Try Different Alignments
// This moves the board's center to position (1,2)
<board
boardAnchorPosition={{x:1, y:2}}
boardAnchorAlignment="center" // Try changing this to other values
width="10mm"
height="10mm"
>
<resistor resistance="1k" footprint="0402" name="R1" />
</board>
How Anchoring Works
- The
boardAnchorAlignmentdetermines which point on the board is considered the anchor point - The
boardAnchorPositionmoves that anchor point to the specified (x,y) coordinates
Example Alignments:
"center"- Board is centered on the anchor point"top_left"- Top-left corner is at the anchor point"top_right"- Top-right corner is at the anchor point"bottom_left"- Bottom-left corner is at the anchor point"bottom_right"- Bottom-right corner is at the anchor point"center_left"- Middle of the left edge is at the anchor point"center_right"- Middle of the right edge is at the anchor point"top_center"- Top center point is at the anchor point"bottom_center"- Bottom center point is at the anchor point
Flexible PCBs
Interested in flexible PCBs? Upvote this issue on Github!