Migrating to useVyre

Step-by-step guides for moving your project to useVyre from another design system. Pick your starting point below.


General migration steps

These steps apply regardless of where you're coming from.

  1. Install useVyre — tokens package is always required, plus the framework package for React or Vue.
npm install @usevyre/tokens @usevyre/react
# or with all AI tooling bundled
npm install @usevyre/react-all
  1. Import styles at your app entry point — tokens CSS + component styles.
// main.tsx
import "@usevyre/tokens/css";
import "@usevyre/react/styles";
  1. Add AI context so your coding agent knows every valid prop and variant — no more hallucinated class names.
# Generate agent context file in one command
npx @usevyre/ai-context init --claude   # → CLAUDE.md
npx @usevyre/ai-context init --cursor   # → .cursor/rules
npx @usevyre/ai-context init --windsurf # → .windsurf/rules
  1. Replace components gradually. useVyre can coexist with your old system during migration — you don't need to do it all at once. Start with high-traffic components like Button, Input, and Modal.
Tip: Run npx @usevyre/validate-ai-context src/ after migration to catch any leftover invalid props before they reach production.

Migrate from...

Tailwind UI gives you unstyled markup with utility classes. useVyre trades the class-string approach for semantic component props — less to type, nothing for your AI agent to hallucinate.

Install

# useVyre doesn't require Tailwind — you can remove it,
# or keep it alongside useVyre during a gradual migration.
npm install @usevyre/tokens @usevyre/react

Component mapping

Tailwind UI / Headless UIuseVyre
Custom className buttonButton variant prop
Dialog (Headless UI)Modal
Disclosure (Headless UI)Accordion
Listbox (Headless UI)Select
Combobox (Headless UI)Command
Switch (Headless UI)Switch ✓ same name
Popover (Headless UI)Popover ✓ same name
Tooltip (Headless UI)Tooltip ✓ same name
bg-primary text-white classesvar(--vyre-color-semantic-accent)
rounded-lgvar(--vyre-radius-lg)
shadow-mdvar(--vyre-shadow-md)
p-4var(--vyre-spacing-4)

Button

Tailwind UI

// Tailwind UI — custom styled button
<button
  className="rounded-md bg-violet-600 px-4 py-2 text-sm font-semibold
             text-white hover:bg-violet-500 disabled:opacity-50"
>
  Save changes
</button>

useVyre

// useVyre — semantic props, no class lists
import { Button } from "@usevyre/react";

<Button variant="accent">Save changes</Button>

Dialog (Headless UI) → Modal

Headless UI

// Headless UI
import { Dialog } from "@headlessui/react";

<Dialog open={open} onClose={setOpen}>
  <Dialog.Panel className="...">
    <Dialog.Title className="...">Confirm</Dialog.Title>
    ...
  </Dialog.Panel>
</Dialog>

useVyre

// useVyre — accessibility built in, no class config
import { Modal } from "@usevyre/react";

<Modal open={open} onClose={() => setOpen(false)} title="Confirm">
  ...
</Modal>

Tokens: utility classes → CSS variables

useVyre's semantic tokens are CSS variables. They work in inline styles, plain CSS files, CSS Modules, or SCSS — no Tailwind config needed.

Tailwind UI

/* Tailwind — arbitrary color values or config */
<div className="bg-violet-600 text-white rounded-lg p-4 shadow-md">

useVyre

/* useVyre — semantic CSS variables, theme-aware */
<div style={{
  background: "var(--vyre-color-semantic-accent)",
  color: "var(--vyre-color-semantic-on-accent)",
  borderRadius: "var(--vyre-radius-lg)",
  padding: "var(--vyre-spacing-4)",
  boxShadow: "var(--vyre-shadow-md)",
}}>

/* Or use a Card component */
import { Card, CardBody } from "@usevyre/react";
<Card variant="elevated"><CardBody>...</CardBody></Card>

Validate after migration

Run the validator on your codebase to catch any invalid props or leftover patterns from the old system:

# Scan your source directory for invalid useVyre prop usage
npx @usevyre/validate-ai-context src/

# Output as JSON for CI integration
npx @usevyre/validate-ai-context src/ --json