Skip to main content

<switch />

Overview

A switch is a mechanical device that can be used to connect or disconnect a circuit.

export default () => (
<switch name="SW1" type="spst" />
)
Schematic Circuit Preview

Properties

PropertyTypeDescription
type"spst" | "spdt" | "dpst" | "dpdt"The type of switch
isNormallyClosedbooleanWhether the switch is normally closed

Types of Switches

TypeDescription
spstSingle Pole Single Throw - The simplest switch type with one input and one output
spdtSingle Pole Double Throw - One input that can be connected to either of two outputs
dpstDouble Pole Single Throw - Two separate inputs each connecting to their own output
dpdtDouble Pole Double Throw - Two separate inputs that can each connect to either of two outputs
export default () => (
<group>
<switch name="SW1" type="spst" schX={-1} schY={-1} />
<switch name="SW1" type="spdt" schX={1} schY={-1} />
<switch name="SW3" type="dpst" schX={-1} schY={1} />
<switch name="SW4" type="dpdt" schX={1} schY={1} />
</group>
)
Schematic Circuit Preview

When to use <switch /> vs <pushbutton />

You should always use <pushbutton /> or any more specific switch element when possible. <switch /> is a more generic element with less defaults.