MachineSwitch API
MachineSwitch is a client-only Foundry control for binary state that should feel physical, deliberate, and industrial.
Preview components
Open the component docs to see examples, combinations, and usage patterns built on top of this API.
- MachineSwitchPhysical switch examples and Foundry control patterns.
Preview
Import
import { MachineSwitch } from "@axonyx/react/client";Props
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | undefined | Controlled switch state. |
| defaultChecked | boolean | false | Initial state for uncontrolled usage. |
| onCheckedChange | (checked: boolean) => void | undefined | Called when the switch toggles. |
| label | ReactNode | undefined | Readable label for the control plate. |
| onLabel / offLabel | ReactNode | "On" / "Off" | Visible state labels on the control. |
CSS contract
.ax-machine-switch .ax-machine-switch__lamp .ax-machine-switch__track .ax-machine-switch__knob .ax-machine-switch__label [data-state="on" | "off"]
Foundry notes
Use for deliberate state changes
MachineSwitch should feel heavier than a normal switch. Use it for publish gates, runtime modes, dangerous operations, and industrial dashboards.