How UIFFork works: File-based versioning and runtime switching
mainUIFork enables structured UI iteration using three core mechanisms:
1. File-based versions
Each variation is a real file on disk (e.g., Button.v1.tsx, Button.v2.tsx). This allows for source control history, AI generation, and file-level diffing.
2. Wrapper-based rendering
When you initialize a component, UIFFork replaces it with a wrapper. This wrapper:
- Reads the active version from
localStorage. - Dynamically imports the correct version file.
- Re-renders instantly when the version is switched.
3. Runtime switching
The UIFFork widget allows you to switch versions instantly. It persists your selection in localStorage. You can also use keyboard shortcuts to cycle through versions:
- Mac:
Cmd + Arrow Up/Down - Windows/Linux:
Ctrl + Arrow Up/Down