npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tscircuit/props

v0.0.424

Published

Props for tscircuit builtin component types

Downloads

70,544

Readme

@tscircuit/props

This repo contains all the prop definitions and zod parsers for tscircuit builtin TSX components, e.g. <resistor />, <diode />, <capacitor /> etc. All tscircuit features typically start with a new props definition.

Contributor Getting Started Video

This repo is the source-of-truth for defining the React props, API changes begin here. The focus of the API is on ergonomics for the user (unlike circuit-json which focuses on ergonomics for a renderer)

import type { ResistorProps, ResistorPropsInput } from "@tscircuit/props";
import { resistorProps } from "@tscircuit/props";

resistorProps.parse({ resistance: "10k" } as ResistorPropsInput);
// { resistance: 10_000 }

Available Components

| Component | Props Interface | | ------------------------------ | ------------------------------------------------------------------------------------------ | | <analogsimulation /> | AnalogSimulationProps | | <battery /> | BatteryProps | | <board /> | BoardProps | | <breakout /> | BreakoutProps | | <breakoutpoint /> | BreakoutPointProps | | <cadassembly /> | CadAssemblyProps | | <cadmodel /> | CadModelProps | | <capacitor /> | CapacitorProps | | <chip /> | ChipProps | | <connector /> | ConnectorProps | | <constrainedlayout /> | ConstrainedLayoutProps | | <constraint /> | ConstraintProps | | <copperpour /> | CopperPourProps | | <coppertext /> | CopperTextProps | | <courtyardoutline /> | CourtyardOutlineProps | | <courtyardrect /> | CourtyardRectProps | | <crystal /> | CrystalProps | | <cutout /> | RectCutoutProps | | <diode /> | DiodeProps | | <fabricationnotedimension /> | FabricationNoteDimensionProps | | <fabricationnotepath /> | FabricationNotePathProps | | <fabricationnoterect /> | FabricationNoteRectProps | | <fabricationnotetext /> | FabricationNoteTextProps | | <fiducial /> | FiducialProps | | <footprint /> | FootprintProps | | <fuse /> | FuseProps | | <group /> | BaseGroupProps | | <hole /> | CircleHoleProps | | <inductor /> | InductorProps | | <interconnect /> | InterconnectProps | | <jumper /> | JumperProps | | <led /> | LedProps | | <mosfet /> | MosfetProps | | <net /> | NetProps | | <netalias /> | NetAliasProps | | <netlabel /> | NetLabelProps | | <panel /> | PanelProps | | <pcbkeepout /> | PcbKeepoutProps | | <pcbnotedimension /> | PcbNoteDimensionProps | | <pcbnoteline /> | PcbNoteLineProps | | <pcbnotepath /> | PcbNotePathProps | | <pcbnoterect /> | PcbNoteRectProps | | <pcbnotetext /> | PcbNoteTextProps | | <pcbtrace /> | PcbTraceProps | | <pinheader /> | PinHeaderProps | | <pinout /> | PinoutProps | | <platedhole /> | CirclePlatedHoleProps | | <port /> | PortProps | | <potentiometer /> | PotentiometerProps | | <powersource /> | PowerSourceProps | | <pushbutton /> | PushButtonProps | | <resistor /> | ResistorProps | | <resonator /> | ResonatorProps | | <schematicarc /> | SchematicArcProps | | <schematicbox /> | SchematicBoxProps | | <schematiccell /> | SchematicCellProps | | <schematiccircle /> | SchematicCircleProps | | <schematicline /> | SchematicLineProps | | <schematicpath /> | SchematicPathProps | | <schematicrect /> | SchematicRectProps | | <schematicrow /> | SchematicRowProps | | <schematictable /> | SchematicTableProps | | <schematictext /> | SchematicTextProps | | <silkscreencircle /> | SilkscreenCircleProps | | <silkscreenline /> | SilkscreenLineProps | | <silkscreenpath /> | SilkscreenPathProps | | <silkscreenrect /> | SilkscreenRectProps | | <silkscreentext /> | SilkscreenTextProps | | <smtpad /> | RectSmtPadProps | | <solderjumper /> | SolderJumperProps | | <solderpaste /> | RectSolderPasteProps | | <stampboard /> | StampboardProps | | <subcircuit /> | SubcircuitProps | | <subpanel /> | SubpanelProps | | <switch /> | SwitchProps | | <symbol /> | SymbolProps | | <testpoint /> | TestpointProps | | <toolingrail /> | ToolingrailProps | | <trace /> | TraceProps | | <tracehint /> | TraceHintProps | | <transistor /> | TransistorProps | | <via /> | ViaProps | | <voltageprobe /> | VoltageProbeProps | | <voltagesource /> | VoltageSourceProps |

Usage Examples

import { resistorProps, type ResistorProps } from "@tscircuit/props";

// Validate component props
const validatedProps = resistorProps.parse({ resistance: "10k" });
// { resistance: 10000 }

// Type safety
const myResistor: ResistorProps = {
  name: "R1",
  resistance: 10000,
  footprint: "0805",
};

Component Interface Definitions

Below are the TypeScript interface definitions for all component props:

CommonComponentProps

export interface CommonComponentProps extends CommonLayoutProps {
  key?: any;
  name: string;
  pinAttributes?: Record<PinLabel, PinAttributeMap>;
  supplierPartNumbers?: SupplierPartNumbers;
  cadModel?: CadModelProp;
  children?: any;
  symbolName?: string;
  doNotPlace?: boolean;
}

Source

SubcircuitGroupProps

export interface SubcircuitGroupProps extends BaseGroupProps {
  manualEdits?: ManualEditsFileInput;
  routingDisabled?: boolean;
  defaultTraceWidth?: Distance;
  minTraceWidth?: Distance;
  pcbRouteCache?: PcbRouteCache;

  autorouter?: AutorouterProp;

  /**
   * If true, we'll automatically layout the schematic for this group. Must be
   * a subcircuit (currently). This is eventually going to be replaced with more
   * sophisticated layout options/modes and will be enabled by default.
   */
  schAutoLayoutEnabled?: boolean;

  /**
   * If true, net labels will automatically be created for complex traces
   */
  schTraceAutoLabelEnabled?: boolean;

  /** Maximum length a trace can span on the schematic */
  schMaxTraceDistance?: Distance;

  partsEngine?: PartsEngine;
}

Source

AnalogSimulationProps <analogsimulation />

export interface AnalogSimulationProps {
  simulationType?: "spice_transient_analysis";
  duration?: number | string;
  timePerStep?: number | string;
  spiceEngine?: AutocompleteString<"spicey" | "ngspice">;
}

Source

BatteryProps <battery />

export interface BatteryProps<
  PinLabel extends string = string,
> extends CommonComponentProps<PinLabel> {
  capacity?: number | string;
  voltage?: number | string;
  standard?: "AA" | "AAA" | "9V" | "CR2032" | "18650" | "C";
  schOrientation?: SchematicOrientation;
}

Source

BoardProps <board />

export interface BoardProps extends Omit<
  SubcircuitGroupProps,
  "subcircuit" | "connections"
> {
  title?: string;
  material?: "fr4" | "fr1";
  /** Number of layers for the PCB */
  layers?: 1 | 2 | 4 | 6 | 8;
  borderRadius?: Distance;
  thickness?: Distance;
  boardAnchorPosition?: Point;
  boardAnchorAlignment?: z.infer<typeof ninePointAnchor>;
  /** Color applied to both top and bottom solder masks */
  solderMaskColor?: BoardColor;
  /** Color of the top solder mask */
  topSolderMaskColor?: BoardColor;
  /** Color of the bottom solder mask */
  bottomSolderMaskColor?: BoardColor;
  /** Color applied to both top and bottom silkscreens */
  silkscreenColor?: BoardColor;
  /** Color of the top silkscreen */
  topSilkscreenColor?: BoardColor;
  /** Color of the bottom silkscreen */
  bottomSilkscreenColor?: BoardColor;
  /** Whether the board should be assembled on both sides */
  doubleSidedAssembly?: boolean;
  /** Whether this board should be omitted from the schematic view */
  schematicDisabled?: boolean;
}

Source

BreakoutProps <breakout />

export interface BreakoutProps extends Omit<
  SubcircuitGroupProps,
  "subcircuit"
> {
  padding?: Distance;
  paddingLeft?: Distance;
  paddingRight?: Distance;
  paddingTop?: Distance;
  paddingBottom?: Distance;
}

Source

BreakoutPointProps <breakoutpoint />

export interface BreakoutPointProps extends Omit<
  PcbLayoutProps,
  "pcbRotation" | "layer"
> {
  connection: string;
}

Source

CadAssemblyProps <cadassembly />

export interface CadAssemblyProps {
  /**
   * The layer that the CAD assembly is designed for. If you set this to "top"
   * then it means the children were intended to represent the top layer. If
   * the <chip /> with this assembly is moved to the bottom layer, then the
   * components will be mirrored.
   *
   * Generally, you shouldn't set this except where it can help prevent
   * confusion because you have a complex multi-layer assembly. Default is
   * "top" and this is most intuitive.
   */
  originalLayer?: LayerRef;

  children?: any;
}

Source

CadModelProps <cadmodel />

export interface CadModelProps extends CadModelBase {
  modelUrl: string;
  stepUrl?: string;
  pcbX?: Distance;
  pcbY?: Distance;
  pcbLeftEdgeX?: Distance;
  pcbRightEdgeX?: Distance;
  pcbTopEdgeY?: Distance;
  pcbBottomEdgeY?: Distance;
  pcbOffsetX?: Distance;
  pcbOffsetY?: Distance;
  pcbZ?: Distance;
}

Source

CapacitorProps <capacitor />

export interface CapacitorProps<
  PinLabel extends string = string,
> extends CommonComponentProps<PinLabel> {
  capacitance: number | string;
  maxVoltageRating?: number | string;
  schShowRatings?: boolean;
  polarized?: boolean;
  decouplingFor?: string;
  decouplingTo?: string;
  bypassFor?: string;
  bypassTo?: string;
  maxDecouplingTraceLength?: number;
  schOrientation?: SchematicOrientation;
  schSize?: SchematicSymbolSize;
  connections?: Connections<CapacitorPinLabels>;
}

Source

ChipProps <chip />

export interface ChipPropsSU<
  PinLabel extends SchematicPinLabel = SchematicPinLabel,
> extends CommonComponentProps<PinLabel> {
  manufacturerPartNumber?: string;
  pinLabels?: PinLabelsProp<SchematicPinLabel, PinLabel>;
  /**
   * Whether to show pin aliases in the schematic
   */
  showPinAliases?: boolean;
  /**
   * Labels for PCB pins
   */
  pcbPinLabels?: Record<string, string>;
  schPinArrangement?: SchematicPortArrangement;
  /** @deprecated Use schPinArrangement instead. */
  schPortArrangement?: SchematicPortArrangement;
  pinCompatibleVariants?: PinCompatibleVariant[];
  schPinStyle?: SchematicPinStyle;
  schPinSpacing?: Distance;
  schWidth?: Distance;
  schHeight?: Distance;
  noSchematicRepresentation?: boolean;
  internallyConnectedPins?: (string | number)[][];
  externallyConnectedPins?: string[][];
  connections?: Connections<PinLabel>;
}

Source

ConnectorProps <connector />

export interface ConnectorProps extends CommonComponentProps {
  manufacturerPartNumber?: string;
  pinLabels?: Record<
    number | SchematicPinLabel,
    SchematicPinLabel | SchematicPinLabel[]
  >;
  schPinStyle?: SchematicPinStyle;
  schPinSpacing?: number | string;
  schWidth?: number | string;
  schHeight?: number | string;
  schDirection?: "left" | "right";
  schPortArrangement?: SchematicPortArrangement;
  /**
   * Groups of pins that are internally connected
   * e.g., [["1","2"], ["2","3"]]
   */
  internallyConnectedPins?: (string | number)[][];
  /**
   * Connector standard, e.g. usb_c, m2
   */
  standard?: "usb_c" | "m2";
}

Source

ConstrainedLayoutProps <constrainedlayout />

export interface ConstrainedLayoutProps {
  name?: string;
  pcbOnly?: boolean;
  schOnly?: boolean;
}

Source

ConstraintProps <constraint />

export type ConstraintProps =
  | PcbXDistConstraint
  | PcbYDistConstraint
  | PcbSameYConstraint
  | PcbSameXConstraint;

// -----------------------------------------------------------------------------
// Zod
// -----------------------------------------------------------------------------

Source

CopperPourProps <copperpour />

export interface CopperPourProps {
  name?: string;
  layer: LayerRefInput;
  connectsTo: string;
  padMargin?: Distance;
  traceMargin?: Distance;
  clearance?: Distance;
  boardEdgeMargin?: Distance;
  cutoutMargin?: Distance;
  coveredWithSolderMask?: boolean;
}

Source

CopperTextProps <coppertext />

export type CopperTextProps = z.input<typeof copperTextProps>;

Source

CourtyardOutlineProps <courtyardoutline />

export type CourtyardOutlineProps = z.input<typeof courtyardOutlineProps>;

Source

CourtyardRectProps <courtyardrect />

export type CourtyardRectProps = z.input<typeof courtyardRectProps>;

Source

CrystalProps <crystal />

export interface CrystalProps<
  PinLabel extends string = string,
> extends CommonComponentProps<PinLabel> {
  frequency: number | string;
  loadCapacitance: number | string;
  manufacturerPartNumber?: string;
  mpn?: string;
  pinVariant?: PinVariant;
  schOrientation?: SchematicOrientation;
  connections?: Connections<CrystalPinLabels>;
}

Source

RectCutoutProps <cutout />

export interface RectCutoutProps extends Omit<
  PcbLayoutProps,
  "layer" | "pcbRotation"
> {
  name?: string;
  shape: "rect";
  width: Distance;
  height: Distance;
}

Source

DiodeProps <diode />

export interface DiodeProps<
  PinLabel extends string = string,
> extends CommonComponentProps<PinLabel> {
  connections?: {
    anode?: string | string[] | readonly string[];
    cathode?: string | string[] | readonly string[];
    pin1?: string | string[] | readonly string[];
    pin2?: string | string[] | readonly string[];
    pos?: string | string[] | readonly string[];
    neg?: string | string[] | readonly string[];
  };
  variant?: "standard" | "schottky" | "zener" | "avalanche" | "photo" | "tvs";
  standard?: boolean;
  schottky?: boolean;
  zener?: boolean;
  avalanche?: boolean;
  photo?: boolean;
  tvs?: boolean;
  schOrientation?: SchematicOrientation;
}

Source

FabricationNoteDimensionProps <fabricationnotedimension />

export interface FabricationNoteDimensionProps extends Omit<
  PcbLayoutProps,
  | "pcbLeftEdgeX"
  | "pcbRightEdgeX"
  | "pcbTopEdgeY"
  | "pcbBottomEdgeY"
  | "pcbX"
  | "pcbY"
  | "pcbOffsetX"
  | "pcbOffsetY"
  | "pcbRotation"
> {
  from: string | Point;
  to: string | Point;
  text?: string;
  offset?: string | number;
  font?: "tscircuit2024";
  fontSize?: string | number;
  color?: string;
  arrowSize?: string | number;
  units?: "in" | "mm";
  outerEdgeToEdge?: true;
  centerToCenter?: true;
  innerEdgeToEdge?: true;
}

Source

FabricationNotePathProps <fabricationnotepath />

export type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>;

Source

FabricationNoteRectProps <fabricationnoterect />

export type FabricationNoteRectProps = z.input<typeof fabricationNoteRectProps>;

Source

FabricationNoteTextProps <fabricationnotetext />

export interface FabricationNoteTextProps extends PcbLayoutProps {
  text: string;
  anchorAlignment?:
    | "center"
    | "top_left"
    | "top_right"
    | "bottom_left"
    | "bottom_right";
  font?: "tscircuit2024";
  fontSize?: string | number;
  color?: string;
}

Source

FiducialProps <fiducial />

export interface FiducialProps extends CommonComponentProps {
  soldermaskPullback?: Distance;
  padDiameter?: Distance;
}

Source

FootprintProps <footprint />

export interface FootprintProps {
  children?: any;
  /**
   * The layer that the footprint is designed for. If you set this to "top"
   * then it means the children were intended to represent the top layer. If
   * the <chip /> with this footprint is moved to the bottom layer, then the
   * components will be mirrored.
   *
   * Generally, you shouldn't set this except where it can help prevent
   * confusion because you have a complex multi-layer footprint. Default is
   * "top" and this is most intuitive.
   */
  originalLayer?: LayerRef;
  /**
   * Serialized circuit JSON describing a precompiled footprint
   */
  circuitJson?: any[];
}

Source

FuseProps <fuse />

export interface FuseProps<
  PinLabel extends string = string,
> extends CommonComponentProps<PinLabel> {
  /**
   * Current rating of the fuse in amperes
   */
  currentRating: number | string;

  /**
   * Voltage rating of the fuse
   */
  voltageRating?: number | string;

  /**
   * Whether to show ratings on schematic
   */
  schShowRatings?: boolean;

  schOrientation?: SchematicOrientation;

  /**
   * Connections to other components
   */
  connections?: Connections<PinLabel>;
}

Source

BaseGroupProps

export interface BaseGroupProps extends CommonLayoutProps, LayoutConfig {
  name?: string;
  key?: any;
  children?: any;

  pcbStyle?: PcbStyle;

  /**
   * Title to display above this group in the schematic view
   */
  schTitle?: string;

  /**
   * If true, render this group as a single schematic box
   */
  showAsSchematicBox?: boolean;

  /**
   * Mapping of external pin names to internal connection targets
   */
  connections?: Connections;

  /**
   * Arrangement for pins when rendered as a schematic box
   */
  schPinArrangement?: SchematicPinArrangement;

  /**
   * Spacing between pins when rendered as a schematic box
   */
  schPinSpacing?: Distance;

  /**
   * Styles to apply to individual pins in the schematic box representation
   */
  schPinStyle?: SchematicPinStyle;

  pcbWidth?: Distance;
  pcbHeight?: Distance;
  minTraceWidth?: Distance;
  schWidth?: Distance;
  schHeight?: Distance;

  pcbLayout?: LayoutConfig;
  schLayout?: LayoutConfig;
  cellBorder?: Border | null;
  border?: Border | null;
  schPadding?: Distance;
  schPaddingLeft?: Distance;
  schPaddingRight?: Distance;
  schPaddingTop?: Distance;
  schPaddingBottom?: Distance;

  pcbPadding?: Distance;
  pcbPaddingLeft?: Distance;
  pcbPaddingRight?: Distance;
  pcbPaddingTop?: Distance;
  pcbPaddingBottom?: Distance;
  /**
   * Anchor to use when interpreting pcbX/pcbY/pcbOffsetX/pcbOffsetY relative to pcbPosition
   */
  pcbPositionAnchor?: AutocompleteString<z.infer<typeof ninePointAnchor>>;

  /** @deprecated Use `pcbGrid` */
  grid?: boolean;
  /** @deprecated Use `pcbFlex` */
  flex?: boolean | string;

  pcbGrid?: boolean;
  pcbGridCols?: number | string;
  pcbGridRows?: number | string;
  pcbGridTemplateRows?: string;
  pcbGridTemplateColumns?: string;
  pcbGridTemplate?: string;
  pcbGridGap?: number | string;
  pcbGridRowGap?: number | string;
  pcbGridColumnGap?: number | string;

  pcbFlex?: boolean | string;
  pcbFlexGap?: number | string;
  pcbFlexDirection?: "row" | "column";
  pcbAlignItems?: "start" | "center" | "end" | "stretch";
  pcbJustifyContent?:
    | "start"
    | "center"
    | "end"
    | "stretch"
    | "space-between"
    | "space-around"
    | "space-evenly";
  pcbFlexRow?: boolean;
  pcbFlexColumn?: boolean;
  pcbGap?: number | string;
  pcbPack?: boolean;
  pcbPackGap?: number | string;

  schGrid?: boolean;
  schGridCols?: number | string;
  schGridRows?: number | string;
  schGridTemplateRows?: string;
  schGridTemplateColumns?: string;
  schGridTemplate?: string;
  schGridGap?: number | string;
  schGridRowGap?: number | string;
  schGridColumnGap?: number | string;

  schFlex?: boolean | string;
  schFlexGap?: number | string;
  schFlexDirection?: "row" | "column";
  schAlignItems?: "start" | "center" | "end" | "stretch";
  schJustifyContent?:
    | "start"
    | "center"
    | "end"
    | "stretch"
    | "space-between"
    | "space-around"
    | "space-evenly";
  schFlexRow?: boolean;
  schFlexColumn?: boolean;
  schGap?: number | string;
  schPack?: boolean;
  schMatchAdapt?: boolean;
}

Source

CircleHoleProps <hole />

export interface CircleHoleProps extends PcbLayoutProps {
  name?: string;
  shape?: "circle";
  diameter?: Distance;
  radius?: Distance;
  solderMaskMargin?: Distance;
  coveredWithSolderMask?: boolean;
}

Source

InductorProps <inductor />

export interface InductorProps<
  PinLabel extends string = string,
> extends CommonComponentProps<PinLabel> {
  inductance: number | string;
  maxCurrentRating?: number | string;
  schOrientation?: SchematicOrientation;
  connections?: Connections<InductorPinLabels>;
}

Source

InterconnectProps <interconnect />

export interface InterconnectProps extends CommonComponentProps {
  standard?: "TSC0001_36P_XALT_2025_11" | "0805" | "0603" | "1206";
}

Source

JumperProps <jumper />

export interface JumperProps extends CommonComponentProps {
  manufacturerPartNumber?: string;
  pinLabels?: Record<
    number | SchematicPinLabel,
    SchematicPinLabel | SchematicPinLabel[]
  >;
  schPinStyle?: SchematicPinStyle;
  schPinSpacing?: number | string;
  schWidth?: number | string;
  schHeight?: number | string;
  schDirection?: "left" | "right";
  schPinArrangement?: SchematicPortArrangement;
  /**
   * @deprecated Use schPinArrangement instead.
   */
  schPortArrangement?: SchematicPortArrangement;
  /**
   * Labels for PCB pins
   */
  pcbPinLabels?: Record<string, string>;
  /**
   * Number of pins on the jumper (2 or 3)
   */
  pinCount?: 2 | 3;
  /**
   * Groups of pins that are internally connected
   * e.g., [["1","2"], ["2","3"]]
   */
  internallyConnectedPins?: (string | number)[][];
  /**
   * Connections to other components
   */
  connections?: Connections<string>;
}

Source

LedProps <led />

export type LedProps = z.input<typeof ledProps>;

Source

MosfetProps <mosfet />

export interface MosfetProps<
  PinLabel extends string = string,
> extends CommonComponentProps<PinLabel> {
  channelType: "n" | "p";
  mosfetMode: "enhancement" | "depletion";
}

Source

NetProps <net />

export interface NetProps {
  name: string;
  connectsTo?: string | string[];
  highlightColor?: string;
  isPowerNet?: boolean;
  isGroundNet?: boolean;
}

Source

NetAliasProps <netalias />

export interface NetAliasProps {
  net?: string;
  connection?: string;
  schX?: number | string;
  schY?: number | string;
  schRotation?: number | string;
  anchorSide?: "left" | "top" | "right" | "bottom";
}

Source

NetLabelProps <netlabel />

export interface NetLabelProps {
  net?: string;
  connection?: string;
  connectsTo?: string | string[];
  schX?: number | string;
  schY?: number | string;
  schRotation?: number | string;
  anchorSide?: "left" | "top" | "right" | "bottom";
}

Source

PanelProps <panel />

export interface PanelProps extends Omit<
  BaseGroupProps,
  "height" | "layoutMode" | "width"
> {
  width?: Distance;
  height?: Distance;
  children?: BaseGroupProps["children"];
  /**
   * If true, prevent a solder mask from being applied to this panel.
   */
  noSolderMask?: boolean;
  /** Method for panelization */
  panelizationMethod?: "tab-routing" | "none";
  /** Gap between boards in a panel */
  boardGap?: Distance;
  boardAreaWidth?: Distance;
  boardAreaHeight?: Distance;
  layoutMode?: "grid" | "pack" | "none";
  row?: number;
  col?: number;
  cellWidth?: Distance;
  cellHeight?: Distance;
  tabWidth?: Distance;
  tabLength?: Distance;
  mouseBites?: boolean;
}

Source

PcbKeepoutProps <pcbkeepout />

export type PcbKeepoutProps = z.input<typeof pcbKeepoutProps>;

Source

PcbNoteDimensionProps <pcbnotedimension />

export interface PcbNoteDimensionProps extends Omit<
  PcbLayoutProps,
  | "pcbLeftEdgeX"
  | "pcbRightEdgeX"
  | "pcbTopEdgeY"
  | "pcbBottomEdgeY"
  | "pcbX"
  | "pcbY"
  | "pcbOffsetX"
  | "pcbOffsetY"
  | "pcbRotation"
> {
  from: string | Point;
  to: string | Point;
  text?: string;
  offset?: string | number;
  font?: "tscircuit2024";
  fontSize?: string | number;
  color?: string;
  arrowSize?: string | number;
  units?: "in" | "mm";
  outerEdgeToEdge?: true;
  centerToCenter?: true;
  innerEdgeToEdge?: true;
}

Source

PcbNoteLineProps <pcbnoteline />

export interface PcbNoteLineProps extends Omit<
  PcbLayoutProps,
  | "pcbLeftEdgeX"
  | "pcbRightEdgeX"
  | "pcbTopEdgeY"
  | "pcbBottomEdgeY"
  | "pcbX"
  | "pcbY"
  | "pcbOffsetX"
  | "pcbOffsetY"
  | "pcbRotation"
> {
  x1: string | number;
  y1: string | number;
  x2: string | number;
  y2: string | number;
  strokeWidth?: string | number;
  color?: string;
  isDashed?: boolean;
}

Source

PcbNotePathProps <pcbnotepath />

export interface PcbNotePathProps extends Omit<
  PcbLayoutProps,
  | "pcbLeftEdgeX"
  | "pcbRightEdgeX"
  | "pcbTopEdgeY"
  | "pcbBottomEdgeY"
  | "pcbX"
  | "pcbY"
  | "pcbOffsetX"
  | "pcbOffsetY"
  | "pcbRotation"
> {
  route: RouteHintPointInput[];
  strokeWidth?: string | number;
  color?: string;
}

Source

PcbNoteRectProps <pcbnoterect />

export interface PcbNoteRectProps extends Omit<PcbLayoutProps, "pcbRotation"> {
  width: string | number;
  height: string | number;
  strokeWidth?: string | number;
  isFilled?: boolean;
  hasStroke?: boolean;
  isStrokeDashed?: boolean;
  color?: string;
  cornerRadius?: string | number;
}

Source

PcbNoteTextProps <pcbnotetext />

export interface PcbNoteTextProps extends PcbLayoutProps {
  text: string;
  anchorAlignment?:
    | "center"
    | "top_left"
    | "top_right"
    | "bottom_left"
    | "bottom_right";
  font?: "tscircuit2024";
  fontSize?: string | number;
  color?: string;
}

Source

PcbTraceProps <pcbtrace />

export type PcbTraceProps = z.input<typeof pcbTraceProps>;

Source

PinHeaderProps <pinheader />

export interface PinHeaderProps extends CommonComponentProps {
  /**
   * Number of pins in the header
   */
  pinCount: number;

  /**
   * Distance between pins
   */
  pitch?: number | string;

  /**
   * Schematic facing direction
   */
  schFacingDirection?: "up" | "down" | "left" | "right";

  /**
   * Whether the header is male, female, or unpopulated
   */
  gender?: "male" | "female" | "unpopulated";

  /**
   * Whether to show pin labels in silkscreen
   */
  showSilkscreenPinLabels?: boolean;

  /**
   * Labels for PCB pins
   */
  pcbPinLabels?: Record<string, string>;

  /**
   * Whether the header has two rows of pins
   */
  doubleRow?: boolean;

  /**
   * If true, the header is a right-angle style connector
   */
  rightAngle?: boolean;

  /**
   * Orientation of the header on the PCB
   */
  pcbOrientation?: PcbOrientation;

  /**
   * Diameter of the through-hole for each pin
   */
  holeDiameter?: number | string;

  /**
   * Diameter of the plated area around each hole
   */
  platedDiameter?: number | string;

  /**
   * Labels for each pin
   */
  pinLabels?: Record<string, SchematicPinLabel> | SchematicPinLabel[];

  /**
   * Connections to other components
   */
  connections?: Connections<string>;

  /**
   * Direction the header is facing
   */
  facingDirection?: "left" | "right";

  /**
   * Pin arrangement in schematic view
   */
  schPinArrangement?: SchematicPinArrangement;

  /**
   * Schematic pin style (margins, etc)
   */
  schPinStyle?: SchematicPinStyle;

  /**
   * Schematic pin spacing
   */
  schPinSpacing?: number | string;

  /**
   * Schematic width
   */
  schWidth?: number | string;

  /**
   * Schematic height
   */
  schHeight?: number | string;
}

Source

CirclePlatedHoleProps <platedhole />

export interface CirclePlatedHoleProps extends Omit<
  PcbLayoutProps,
  "pcbRotation" | "layer"
> {
  name?: string;
  connectsTo?: string | string[];
  shape: "circle";
  holeDiameter: number | string;
  outerDiameter: number | string;
  padDiameter?: number | string;
  portHints?: PortHints;
  solderMaskMargin?: Distance;
  coveredWithSolderMask?: boolean;
}

Source

PortProps <port />

export type PortProps = z.input<typeof portProps>;

Source

PotentiometerProps <potentiometer />

export interface PotentiometerProps extends CommonComponentProps {
  maxResistance: number | string;
  pinVariant?: PotentiometerPinVariant;
}

Source

PowerSourceProps <powersource />

export type PowerSourceProps = z.input<typeof powerSourceProps>;

Source

PushButtonProps <pushbutton />

export type PushButtonProps<T extends PinLabelsProp | string = string> =
  ChipProps<T>;

Source

ResistorProps <resistor />

export interface ResistorProps<
  PinLabel extends string = string,
> extends CommonComponentProps<PinLabel> {
  resistance: number | string;
  pullupFor?: string;
  pullupTo?: string;
  pulldownFor?: string;
  pulldownTo?: string;
  schOrientation?: SchematicOrientation;
  schSize?: SchematicSymbolSize;
  connections?: Connections<ResistorPinLabels>;
}

Source

ResonatorProps <resonator />

export interface ResonatorProps extends CommonComponentProps {
  frequency: number | string;
  loadCapacitance: number | string;
  pinVariant?: ResonatorPinVariant;
}

Source

SchematicArcProps <schematicarc />

export type SchematicArcProps = z.input<typeof schematicArcProps>;

Source

SchematicBoxProps <schematicbox />

export type SchematicBoxProps = z.input<typeof schematicBoxProps>;

Source

SchematicCellProps <schematiccell />

export interface SchematicCellProps {
  children?: string;
  horizontalAlign?: "left" | "center" | "right";
  verticalAlign?: "top" | "middle" | "bottom";
  fontSize?: number | string;
  rowSpan?: number;
  colSpan?: number;
  width?: number | string;
  text?: string;
}

Source

SchematicCircleProps <schematiccircle />

export type SchematicCircleProps = z.input<typeof schematicCircleProps>;

Source

SchematicLineProps <schematicline />

export type SchematicLineProps = z.input<typeof schematicLineProps>;

Source

SchematicPathProps <schematicpath />

export type SchematicPathProps = z.input<typeof schematicPathProps>;

Source

SchematicRectProps <schematicrect />

export type SchematicRectProps = z.input<typeof schematicRectProps>;

Source

SchematicRowProps <schematicrow />

export interface SchematicRowProps {
  children?: any;
  height?: number | string;
}

Source

SchematicTableProps <schematictable />

export interface SchematicTableProps {
  schX?: number | string;
  schY?: number | string;
  children?: any;
  cellPadding?: number | string;
  borderWidth?: number | string;
  anchor?: z.infer<typeof ninePointAnchor>;
  fontSize?: number | string;
}

Source

SchematicTextProps <schematictext />

export type SchematicTextProps = z.input<typeof schematicTextProps>;

Source

SilkscreenCircleProps <silkscreencircle />

export type SilkscreenCircleProps = z.input<typeof silkscreenCircleProps>;

Source

SilkscreenLineProps <silkscreenline />

export type SilkscreenLineProps = z.input<typeof silkscreenLineProps>;

Source

SilkscreenPathProps <silkscreenpath />

export type SilkscreenPathProps = z.input<typeof silkscreenPathProps>;

Source

SilkscreenRectProps <silkscreenrect />

export type SilkscreenRectProps = z.input<typeof silkscreenRectProps>;

Source

SilkscreenTextProps <silkscreentext />

export type SilkscreenTextProps = z.input<typeof silkscreenTextProps>;

Source

RectSmtPadProps <smtpad />

export interface RectSmtPadProps extends Omit<PcbLayoutProps, "pcbRotation"> {
  name?: string;
  shape: "rect";
  width: Distance;
  height: Distance;
  rectBorderRadius?: Distance;
  cornerRadius?: Distance;
  portHints?: PortHints;
  coveredWithSolderMask?: boolean;
  solderMaskMargin?: Distance;
}

Source

SolderJumperProps <solderjumper />

export interface SolderJumperProps extends JumperProps {
  /**
   * Pins that are bridged with solder by default
   */
  bridgedPins?: string[][];
  /**
   * If true, all pins are connected with cuttable traces
   */
  bridged?: boolean;
}

Source

RectSolderPasteProps <solderpaste />

export interface RectSolderPasteProps extends Omit<
  PcbLayoutProps,
  "pcbRotation"
> {
  shape: "rect";
  width: Distance;
  height: Distance;
}

Source

StampboardProps <stampboard />

export interface StampboardProps extends BoardProps {
  leftPinCount?: number;
  rightPinCount?: number;
  topPinCount?: number;
  bottomPinCount?: number;
  leftPins?: string[];
  rightPins?: string[];
  topPins?: string[];
  bottomPins?: string[];
  pinPitch?: number | string;
  innerHoles?: boolean;
}

Source

SubcircuitProps <subcircuit />

export type SubcircuitProps = SubcircuitGroupProps;

Source

SwitchProps <switch />

export interface SwitchProps extends CommonComponentProps {
  type?: "spst" | "spdt" | "dpst" | "dpdt";
  isNormallyClosed?: boolean;
  spdt?: boolean;
  spst?: boolean;
  dpst?: boolean;
  dpdt?: boolean;
  simSwitchFrequency?: number | string;
  simCloseAt?: number | string;
  simOpenAt?: number | string;
  simStartClosed?: boolean;
  simStartOpen?: boolean;
  connections?: Connections<string>;
}

Source

SymbolProps <symbol />

export interface SymbolProps {
  /**
   * The facing direction that the symbol is designed for. If you set this to "right",
   * then it means the children were intended to represent the symbol facing right.
   * Generally, you shouldn't set this except where it can help prevent confusion
   * because you have a complex symbol. Default is "right" and this is most intuitive.
   */
  originalFacingDirection?: "up" | "down" | "left" | "right";
}

Source

TestpointProps <testpoint />

export interface TestpointProps extends CommonComponentProps {
  /**
   * The footprint variant of the testpoint either a surface pad or through-hole
   */
  footprintVariant?: "pad" | "through_hole";
  /**
   * The shape of the pad if using a pad variant
   */
  padShape?: "rect" | "circle";
  /**
   * Diameter of the copper pad (applies to both SMD pads and plated holes)
   */
  padDiameter?: number | string;
  /**
   * Diameter of the hole if using a through-hole testpoint
   */
  holeDiameter?: number | string;
  /**
   * Width of the pad when padShape is rect
   */
  width?: number | string;
  /**
   * Height of the pad when padShape is rect
   */
  height?: number | string;
  connections?: TestpointConnections;
}

Source

ToolingrailProps <toolingrail />

export interface ToolingrailProps {
  children?: any;
}

Source

TraceProps <trace />

export type TraceProps = z.input<typeof traceProps>;

Source

TraceHintProps <tracehint />

export type TraceHintProps = z.input<typeof traceHintProps>;

Source

TransistorProps <transistor />

export interface TransistorProps<
  PinLabel extends string = string,
> extends CommonComponentProps<PinLabel> {
  type: "npn" | "pnp" | "bjt" | "jfet" | "mosfet" | "igbt";
  connections?: Connections<transistorPinsLabels>;
}

Source

ViaProps <via />

export interface ViaProps extends CommonLayoutProps {
  name?: string;
  fromLayer: LayerRefInput;
  toLayer: LayerRefInput;
  holeDiameter?: number | string;
  outerDiameter?: number | string;
  connectsTo?: string | string[];
  netIsAssignable?: boolean;
}

Source

VoltageProbeProps <voltageprobe />

export interface VoltageProbeProps extends Omit<CommonComponentProps, "name"> {
  name?: string;
  connectsTo: string;
  referenceTo?: string;
  color?: string;
}

Source

VoltageSourceProps <voltagesource />

export interface VoltageSourceProps<
  PinLabel extends string = string,
> extends CommonComponentProps<PinLabel> {
  voltage?: number | string;
  frequency?: number | string;
  peakToPeakVoltage?: number | string;
  waveShape?: WaveShape;
  phase?: number | string;
  dutyCycle?: number | string;
  connections?: Connections<VoltageSourcePinLabels>;
}

Source

tscircuit Platform Configuration

PlatformConfig

export interface PlatformConfig {
  partsEngine?: PartsEngine;

  autorouter?: AutorouterProp;

  autorouterMap?: Record<string, AutorouterDefinition>;

  // TODO this follows a subset of the localStorage interface
  localCacheEngine?: any;

  registryApiUrl?: string;

  cloudAutorouterUrl?: string;

  projectName?: string;
  projectBaseUrl?: string;
  version?: string;
  url?: string;
  printBoardInformationToSilkscreen?: boolean;
  includeBoardFiles?: string[];
  snapshotsDir?: string;

  defaultSpiceEngine?: AutocompleteString<"spicey" | "ngspice">;

  pcbDisabled?: boolean;
  schematicDisabled?: boolean;
  partsEngineDisabled?: boolean;

  spiceEngineMap?: Record<string, SpiceEngine>;

  footprintLibraryMap?: Record<
    string,
    | ((
        path: string,
        options?: { resolvedPcbStyle?: PcbStyle },
      ) => Promise<FootprintLibraryResult>)
    | Record<
        string,
        | any[]
        | ((
            path: string,
            options?: { resolvedPcbStyle?: PcbStyle },
          ) => Promise<FootprintLibraryResult>)
      >
  >;

  footprintFileParserMap?: Record<string, FootprintFileParserEntry>;

  resolveProjectStaticFileImportUrl?: (path: string) => Promise<string>;
  nodeModulesResolver?: (modulePath: string) => Promise<string | null>;
}

Source

tscircuit Project Configuration

ProjectConfig

export interface ProjectConfig extends Pick<
  PlatformConfig,
  | "projectName"
  | "projectBaseUrl"
  | "version"
  | "url"
  | "printBoardInformationToSilkscreen"
  | "includeBoardFiles"
  | "snapshotsDir"
  | "defaultSpiceEngine"
> {}

Source