Point it at any website. Get back a complete design system — React components, Tailwind config, color tokens, and brand assets — ready to drop into your project.
visual-mirror visits a URL with a real browser, reads every visible element's computed styles, captures hover states, and downloads logos and favicons. It then uses an LLM to map raw values to semantic design tokens (primary color, spacing scale, type hierarchy) and generates a portable design package you can copy straight into your codebase.
One command → one folder with:
- React components styled with Tailwind CSS
- A
tailwind.config.jspre-loaded with your extracted color and spacing tokens - A
theme.csswith CSS custom properties for every token - A
DESIGN.mddocumenting the design system in plain language - Brand assets (logos, favicons)
- Node 20+
- An OpenAI API key (or any OpenAI-compatible local LLM)
- Chromium (installed automatically on first run via Playwright)
# Install dependencies
npm ci
# Install the headless browser
npx playwright install chromium
# Create your .env file
cp .env.example .env
# → add your OPENAI_API_KEYYour .env should look like:
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4o # optional, defaults to gpt-4o
OPENAI_BASE_URL= # optional — point to Ollama or any local LLM
LOG_LEVEL=info # optional: debug | info | warn | error# Extract a design system from any public URL
npm run extract -- https://example.com
# Save to a custom folder instead of dist/
npm run extract -- https://example.com my-output-folderThat's it. Output lands in dist/ (or your chosen folder) and is ready to use.
dist/
├── components/
│ ├── Button.jsx # Generated React components
│ ├── Card.jsx
│ ├── Navigation.jsx
│ ├── index.js # Barrel export
│ └── README.md # Component usage guide
├── assets/
│ ├── logos/ # Extracted logo images
│ └── favicons/ # All favicon sizes
├── styles/
│ └── theme.css # CSS custom properties
├── tailwind.config.js # Drop-in Tailwind configuration
├── DESIGN.md # Human-readable design system doc
├── package.json
└── README.md
1. Import the theme:
// main.tsx or main.jsx
import './path/to/dist/styles/theme.css';2. Merge the Tailwind config:
// tailwind.config.js
const extracted = require('./dist/tailwind.config.js');
module.exports = { theme: { extend: { ...extracted.theme.extend } } };3. Use the components:
import { Button, Card } from './dist/components';Set OPENAI_BASE_URL to point at Ollama or any OpenAI-compatible server and the tool will use it instead of the OpenAI API. No API key required.
OPENAI_BASE_URL=http://localhost:11434/v1
OPENAI_MODEL=llama3npm run lint # ESLint — enforces no console.log in src/
npm run test:unit # 21 fast unit tests, no browser needed
npm test # Full suite including live Playwright scrapeISC