Motion Switch
A tactile physics toggle switch with elastic fluid thumb stretching, smooth track morph, particle burst explosion on toggle, and real-time state synchronization.
- 4.2 KB .bexode
- 7 live inputs
- Responsive fit Layout
Use it
The code follows your customizations. Install with npm i exodeui.
import { ExodeUICanvas } from 'exodeui';
// motion-switch.bexode goes in /public (download it below)
export function MotionSwitch() {
return (
<ExodeUICanvas
src="/motion-switch.bexode"
fit="Layout" // responsive: redraws at any container size
autoPlay
interactive
onTrigger={(name) => {
// fires: 'change', 'enabled', 'disabled'
}}
style={{ width: '100%', height: 360 }}
/>
);
}Inputs
| Input | Type | Default | Range |
|---|---|---|---|
checked | Boolean | true | — |
label | Text | Realtime Sync | — |
sublabel | Text | Enable zero-latency vector state synchronization | — |
speed | Number | 1 | 0.1 – 4 |
accent | Text | #10b981 | hex colour |
offColor | Text | #272732 | hex colour |
bg | Text | #090a10 | hex colour |
Events (via onTrigger): changeenableddisabled