Client control

MachineSwitch API

MachineSwitch is a client-only Foundry control for binary state that should feel physical, deliberate, and industrial.

Preview

Import

import { MachineSwitch } from "@axonyx/react/client";

Props

PropTypeDefaultDescription
checkedbooleanundefinedControlled switch state.
defaultCheckedbooleanfalseInitial state for uncontrolled usage.
onCheckedChange(checked: boolean) => voidundefinedCalled when the switch toggles.
labelReactNodeundefinedReadable label for the control plate.
onLabel / offLabelReactNode"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.