ToggleInput
An on/off toggle switch. The inspector renders a pill-shaped toggle.
Runtime value: boolean

Declaration
ts
import { Behaviour, type ToggleInput } from "@relu-interactives/spatial-ecs";
export default class Demo extends Behaviour {
data = {
enabled: true as ToggleInput,
loopAudio: false as ToggleInput,
};
}Runtime usage
Use the value directly as a boolean:
ts
onUpdate() {
if (!this.data.enabled) return;
// ... rest of update logic
}Notes
- Prefer
ToggleInputfor feature flags (e.g. "Enabled", "Loop") andCheckboxInputfor property-style options. - Both types resolve to a plain
booleanat runtime.

