Tactile State Machine Toggle Switch
An interactive toggle switch authored in ExodeUI pairs a two-state Boolean machine with elastic squash-and-stretch geometry. As the thumb traverses the track, inertia elongates its horizontal axis before snapping crisply into the active terminal.
Click the switch; try the checked input to reset it.
Technical Specifications
Interaction Phases
The scene keeps one Idle state. These phases are driven by its inputs and pointer events; the same values appear in the code below.
Use the scene
import { ExodeUICanvas } from 'exodeui';
// interactive-toggle.bexode goes in /public
export function InteractiveToggle() {
return (
<ExodeUICanvas
src="/motion-ui/motion-switch.bexode"
fit="Layout"
autoPlay
interactive
inputs={{
checked: true,
label: 'Realtime Sync',
sublabel: 'Enable zero-latency vector state synchronization',
speed: 1,
accent: '#10b981',
offColor: '#272732',
bg: '#090a10',
}}
onTrigger={(name) => {
// fires: 'change', 'enabled', 'disabled'
}}
style={{ width: '100%', height: 400 }}
/>
);
}This snippet loads /motion-ui/motion-switch.bexode with the same inputs shown in the live stage.
Architectural Breakdown
Traditional UI switches use linear translations that feel static and robotic.
With ExodeUI, the toggle thumb dynamically expands horizontally while in motion to simulate physical inertia, then snaps back to a circle once resting.
State machines guarantee that rapid toggling cannot trigger orphaned transition states or desynchronized visual values.
Frequently Asked Questions
Explore Related Motion Guides & Tooling
Build your next living interface today.
Design fluid physics and visual logic in ExodeUI and export directly to React, Swift, and Flutter.