<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" />
)
Properties
Property | Type | Description |
---|---|---|
type | "spst" | "spdt" | "dpst" | "dpdt" | The type of switch |
isNormallyClosed | boolean | Whether the switch is normally closed |
Types of Switches
Type | Description |
---|---|
spst | Single Pole Single Throw - The simplest switch type with one input and one output |
spdt | Single Pole Double Throw - One input that can be connected to either of two outputs |
dpst | Double Pole Single Throw - Two separate inputs each connecting to their own output |
dpdt | Double 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>
)
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.