Skip to main content
Footprints

<silkscreentext />

Overview

The <silkscreentext /> element is used to add text to the silkscreen layer within a PCB footprint.

export default () => (
<board width="10mm" height="10mm">
<silkscreentext text="Hello, World!" fontSize="1mm" />
</board>
)
PCB Circuit Preview

Properties

PropertyTypeDescription
textstringThe text string to display.
anchorAlignmentenumAlignment of the text. One of "center", "top_left", "top_right", "bottom_left", "bottom_right". Defaults to "center".
fontenumOptional. The font type, e.g. "tscircuit2024".
fontSizelengthOptional. The size of the font. If not specified, inherits from the board's pcbStyle.silkscreenFontSize if set.
isKnockoutbooleanOptional. If true, the text will "knock out" the silkscreen background around it.
knockoutPaddinglengthOptional. Padding around the text when isKnockout is true. Can be a single value or individual sides (e.g., knockoutPaddingLeft).

Knockout Text

Knockout text allows you to create readable text by removing the background silkscreen material. This is particularly useful when text is placed over other silkscreen elements or copper pours.

export default () => (
<board width="20mm" height="20mm">
<silkscreentext
text="KNOCKOUT"
pcbX={0}
pcbY={0}
fontSize="1.5mm"
isKnockout
/>
</board>
)
PCB Circuit Preview

Global Font Size

You can set a global font size for all silkscreen text elements using the pcbStyle prop on the <board /> element. See the board documentation for details.

When a global silkscreenFontSize is set on the board, all <silkscreentext /> elements without an explicit fontSize prop will use that global size. You can still override it by providing a fontSize prop on individual elements.