React library for in-app prototype variant switching. URL-persisted. Zero runtime deps. Works with or without the Vibeflow overlay.
npm install @vibeflow-tools/prototyping · Requires React 18+
Stop rebuilding to review UI states. Bring the switch directly into your running app.
?vf-<name>=<variant>. Share a URL and your reviewer sees the exact variant you're showing them — no screenshots, no guesswork.Provider → hook → switcher. That's the whole model.
VariantProvider once at your app root (or any subtree). All hooks and switcher components beneath it share state through this provider.
useVariant(name, variants) in any component. Pass a map of variant configs — the first key is always the default. The hook resolves URL → localStorage → default.
<VariantSwitcher> for a dot on the element edge, <PageVariantSwitcher> for a fixed segmented control, or <VariantDevToolbar> for a floating panel showing all scopes.
Provider, hook, and switcher — all three in one component tree.
Every export is fully typed. Tree-shake what you don't use.
mode — "dev" (default) hides switcher UI in production · "always" always showsdefaultVisible — initial UI visibility, persisted in localStorageshortcuts — custom keyboard shortcuts or false to disable
position: relative.
name, variants — same values you pass to useVariant.
VariantProvider.
useVariant('Name', {}) and pick up the registered config automatically. Inline variants always win when both are provided.
Two storage layers. URL always takes precedence, letting you share exact states with a link.
?vf-Hero=compactvf-Hero = "compact"
Both layers are managed automatically. For manual control, import utilities: readVariantFromUrl, writeVariantToUrl, resolveActiveVariant and more.
Two shortcuts, both call toggleUiVisible() on the provider.
Customise shortcuts via the shortcuts prop on <VariantProvider>, or pass shortcuts={false} to disable all.
ui-prototyping runs standalone, but unlocks an extra layer when the Vibeflow overlay is present.
<VariantDevToolbar> automatically hides its standalone icon button and registers itself with the overlay's context menu. Access variant controls via right-click → Prototyping — no extra configuration required. Detection is fully automatic.
Four variant scopes — Layout, Hero, TaskCard, and Nav — with inline switchers and URL persistence.
No sign-up. No backend. No API keys. Just install and prototype.
Requires React 18+ · Node.js 18+ · TypeScript support included · Apache 2.0