Skip to main content
Footprints

<silkscreengraphic />

Overview

The <silkscreengraphic /> element places an image on the PCB silkscreen layer. Use it for logos, icons, orientation marks, or other custom artwork that should be drawn as silkscreen instead of copper.

SVG images are converted into silkscreen geometry, so simple single-color SVGs usually produce the cleanest PCB output. PNG images are also accepted.

Basic Example

This example uses a thumbs-up SVG as an inline data URL and places it on the top silkscreen layer.

const thumbsUpSvgUrl =
"data:image/svg+xml,%3Csvg%20width%3D%22800px%22%20height%3D%22800px%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M7%200L5%205V14H14L16%208V5H10V2C10%200.895431%209.10457%200%208%200H7Z%22%20fill%3D%22%23000000%22%2F%3E%3Cpath%20d%3D%22M3%205H0V14H3V5Z%22%20fill%3D%22%23000000%22%2F%3E%3C%2Fsvg%3E"

export default () => (
<board width="14mm" height="12mm">
<silkscreengraphic
imageUrl={thumbsUpSvgUrl}
pcbX={0}
pcbY={0}
width="6mm"
height="6mm"
layer="top"
/>
</board>
)
PCB Circuit Preview

QR Code Example

You can use <silkscreengraphic /> to add a scannable QR code to your PCB silkscreen. This is useful for linking a board to a project page, assembly guide, datasheet, or support URL.

For best results, generate the QR code as a simple, single-color SVG and leave a clear quiet zone around it. Keeping nearby text, traces, pads, and vias away from the QR code makes it easier for a camera to scan.

The example below uses qrcode-svg to generate a QR code for https://tscircuit.com, converts it to a data URL, and places it on the top silkscreen layer. Install the package before using this pattern in your own project: bun add qrcode-svg.

Another option is to create the QR SVG with a generator such as QRCode Monkey. Paste the link you want to encode, download the SVG, then pass it to <silkscreengraphic /> as an imported file, static asset URL, or data URL.

import QRCode from "qrcode-svg"

const qr = new QRCode({
content: "https://tscircuit.com",
padding: 4,
join: true,
container: "svg-viewbox",
})

const qrImageUrl = "data:image/svg+xml;base64," + btoa(qr.svg())

export default () => (
<board width="32mm" height="24mm">
<silkscreentext
text="scan to open tscircuit"
pcbX={0}
pcbY={-9}
fontSize="1.2mm"
layer="top"
/>
<silkscreengraphic
imageUrl={qrImageUrl}
pcbX={0}
pcbY={2}
width="20mm"
height="20mm"
layer="top"
/>
</board>
)
PCB Circuit Preview

Props

PropertyTypeRequiredDefaultDescription
imageUrlstringYes-URL, static-file import, or data URL for an SVG or PNG image.
widthdistanceYes-Rendered width of the graphic on the PCB.
heightdistanceYes-Rendered height of the graphic on the PCB.
layer"top" | "bottom"No"top"PCB silkscreen layer to place the graphic on.
pcbXdistanceNo-X position of the graphic center on the PCB.
pcbYdistanceNo-Y position of the graphic center on the PCB.
pcbRotationangleNo0Rotation of the graphic on the PCB.
pcbPositionAnchornine-point anchorNo"center"Anchor point used when positioning the graphic.
pcbRelativebooleanNofalseInterpret pcbX/pcbY relative to the parent group instead of the board origin.

Notes

  • Use SVG for artwork that should be converted into precise silkscreen paths.
  • Keep source artwork simple and high contrast. Solid, single-color icons work best for PCB silkscreen.
  • For remote assets, make sure the image URL is available when the circuit is built. Inline data URLs or static-file imports make examples easier to share.
  • For QR codes, use at least about 12-15 mm of board space for simple URLs, keep the quiet zone clear, and test the generated PCB preview with a phone camera before ordering.