Ghost-UI captures interactions from any live website and generates clean, production-ready React/Vue/Svelte components using AI vision. See a beautiful animation on Apple's site? Record it. Get working code.
You: *sees amazing navbar animation on Stripe*
You: *opens DevTools*
You: *sees 47 minified CSS classes and obfuscated JS*
You: *cries*
You: *spends 3 hours recreating from scratch*
You: *clicks Ghost-UI extension*
You: *hovers over the navbar*
You: *clicks "Stop"*
Ghost-UI: "Here's your Navbar.tsx with Framer Motion animations"
You: *ships feature before lunch*
# Install globally
npm install -g ghost-ui
# Capture a static element
ghost-ui capture https://stripe.com --selector ".navbar" --output Navbar.tsx
# Record an interaction
ghost-ui record https://apple.com --duration 5s --output HeroAnimation.tsx
Point and click to capture any element. Ghost-UI analyzes the visual appearance and generates semantic code.
# What you see
┌─────────────────────────────────┐
│ ████ Stripe │
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │
│ Products ▼ Solutions ▼ ... │
└─────────────────────────────────┘
# What you get
export function Navbar() {
return (
<nav className="flex items-center justify-between px-6 py-4">
<Logo />
<NavLinks />
<CTAButton />
</nav>
);
}
Record hover states, click animations, scroll effects, and more.
// Captured from: apple.com hero section
export function HeroSection() {
return (
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6, ease: "easeOut" }}
>
<h1 className="text-6xl font-semibold tracking-tight">
iPhone 15 Pro
</h1>
<motion.p
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ delay: 0.3 }}
>
Titanium. So strong. So light. So Pro.
</motion.p>
</motion.div>
);
}
| Framework | Status | Animation Library |
|---|---|---|
| React + Tailwind | ✅ Full | Framer Motion |
| React + CSS Modules | ✅ Full | CSS Animations |
| Vue 3 + Tailwind | ✅ Full | Vue Transitions |
| Svelte | ✅ Full | Svelte Transitions |
| Vanilla HTML/CSS | ✅ Full | CSS Animations |
| React Native | 🚧 Beta | Reanimated |
Ghost-UI doesn't just screenshot—it understands motion:
┌─────────────────────────────────────────────────────────────────┐
│ GHOST-UI │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌─────────────────┐ │
│ │ Browser │───▶│ Recorder │───▶│ Screenshot │ │
│ │ Extension │ │ (Playwright)│ │ + DOM Snap │ │
│ └──────────────┘ └──────────────┘ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ ┌──────────────┐ ┌─────────────────┐ │
│ │ Output │◀───│ Code Gen │◀───│ Vision Model │ │
│ │ Component │ │ Engine │ │ (GPT-4o/etc) │ │
│ └──────────────┘ └──────────────┘ └─────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Create ghost-ui.config.ts in your project:
import { defineConfig } from 'ghost-ui';
export default defineConfig({
// Output settings
output: {
framework: 'react', // 'react' | 'vue' | 'svelte' | 'vanilla'
styling: 'tailwind', // 'tailwind' | 'css-modules' | 'styled-components'
animation: 'framer-motion', // 'framer-motion' | 'css' | 'gsap'
typescript: true,
},
// AI settings
ai: {
provider: 'openai', // 'openai' | 'anthropic' | 'local'
model: 'gpt-4o',
creativity: 0.3, // 0-1, lower = more faithful to original
},
// Component settings
component: {
extractColors: true, // Extract to CSS variables
useSemanticHTML: true, // Use proper HTML elements
addA11y: true, // Add ARIA attributes
responsive: true, // Generate responsive variants
},
// Recording settings
recorder: {
captureHover: true,
captureClick: true,
captureScroll: true,
maxDuration: 10000, // ms
},
});
# Capture a single element
ghost-ui capture <url> --selector <css-selector>
# Record an interaction
ghost-ui record <url> --duration <time>
# Interactive mode (opens browser)
ghost-ui interactive <url>
# Convert existing screenshot to component
ghost-ui from-image ./screenshot.png
# Batch process multiple elements
ghost-ui batch --config ./captures.json
# Capture Stripe's pricing table
ghost-ui capture https://stripe.com/pricing \
--selector ".pricing-table" \
--framework react \
--output PricingTable.tsx
# Record Apple's scroll animation
ghost-ui record https://apple.com/iphone \
--duration 5s \
--scroll \
--output ScrollReveal.tsx
# Capture with custom AI prompt
ghost-ui capture https://linear.app \
--selector ".issue-card" \
--prompt "Make it dark mode with purple accents"
import { GhostUI } from 'ghost-ui';
const ghost = new GhostUI({
ai: { provider: 'openai', model: 'gpt-4o' },
output: { framework: 'react', styling: 'tailwind' },
});
// Capture from URL
const component = await ghost.capture({
url: 'https://stripe.com',
selector: '.hero-section',
});
console.log(component.code);
// → React component code
console.log(component.styles);
// → Extracted styles
console.log(component.assets);
// → Referenced images/icons
Install the Ghost-UI VS Code Extension for inline component generation:
Cmd+Shift+P)Run completely offline with local models:
// ghost-ui.config.ts
export default defineConfig({
ai: {
provider: 'local',
endpoint: 'http://localhost:11434', // Ollama
model: 'llava:34b', // Vision model
},
});
Supported local providers:
Ghost-UI is designed for learning and inspiration, not theft:
Always credit inspiration and create original work.
| Feature | Ghost-UI | Screenshot-to-Code | Figma-to-Code |
|---|---|---|---|
| Live website capture | ✅ | ❌ | ❌ |
| Animation capture | ✅ | ❌ | ❌ |
| Interaction recording | ✅ | ❌ | ❌ |
| Multiple frameworks | ✅ | React only | Varies |
| Local AI support | ✅ | ❌ | ❌ |
| Browser extension | ✅ | ❌ | ❌ |
| CLI tool | ✅ | ❌ | ❌ |
We welcome contributions! See CONTRIBUTING.md for guidelines.
git clone https://github.com/your-org/ghost-ui.git
cd ghost-ui
pnpm install
pnpm dev
MIT © Ghost-UI Contributors
Stop reverse-engineering. Start shipping.