A powerful, AI-driven visual UI builder that converts natural language descriptions into beautiful React components using A2UI (Google's declarative UI protocol). Built with Next.js, TypeScript, and Google's Gemini AI.
- Natural Language to UI: Describe your UI in plain English and watch it come to life
- A2UI Format: Google's declarative JSON protocol for UI components with data binding support
- Component Library: Full integration with shadcn/ui components
- Real-time Preview: See your UI changes instantly in the canvas
- Project Management: Organize your work with projects and multiple screens
- Dark Mode: Built-in theme support with light/dark mode toggle
- Export Ready: Copy your UI manifest as JSON for use in other applications
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- UI Components: shadcn/ui (Radix UI primitives)
- Styling: Tailwind CSS v4
- State Management: Zustand
- AI: Google Gemini 3 Flash
- Icons: Lucide React
- Node.js 18+
- pnpm (recommended) or npm/yarn
- Google Gemini API key (Get one here)
- Clone the repository:
git clone https://github.com/yourusername/a2ui-builder.git
cd a2ui-builder- Install dependencies:
pnpm install- Set up environment variables:
cp .env.example .env.localEdit .env.local and add your Gemini API key:
NEXT_PUBLIC_GEMINI_API_KEY=your_actual_api_key_here
- Run the development server:
pnpm dev- Open http://localhost:3000 in your browser
- Create a Project: Click "New Project" in the sidebar and give it a name
- Add a Screen: Click "Add Screen" under your project
- Describe Your UI: In the chat panel, describe what you want to build
- Example: "Create a modern hero section with a title, description, and primary CTA button"
- View Results: Your UI will appear in the center canvas
- Export: Use the "Manifest" tab to copy your A2UI JSON
The assistant includes quick prompts for common UI patterns:
- Hero sections
- Pricing tables
- Contact forms
- And more...
A2UI (Google's declarative UI protocol) uses a flat array structure where components reference each other by ID:
[
{
"id": "root",
"component": {
"Column": {
"gap": 8,
"children": {
"explicitList": ["header", "content"]
}
}
}
},
{
"id": "header",
"component": {
"Text": {
"text": {
"literalString": "Welcome"
}
}
}
}
]See USAGE.md for detailed examples and ARCHITECTURE.md for technical details.
a2ui-builder/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ │ └── agent/ # Gemini AI agent endpoint
│ ├── dashboard/ # Dashboard pages
│ └── layout.tsx # Root layout
├── components/
│ ├── a2ui/ # A2UI renderer and registry
│ ├── ui/ # shadcn/ui components
│ └── workspace/ # Builder workspace components
├── lib/
│ ├── agent.ts # Gemini AI integration
│ ├── a2ui-catalog.ts # Component catalog
│ ├── store.ts # Zustand state management
│ └── types.ts # TypeScript definitions
└── public/ # Static assets
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLintpnpm dev:mcp- Start MCP server (for component discovery)pnpm mcp:check- Check MCP server health
NEXT_PUBLIC_GEMINI_API_KEY(required) - Your Google Gemini API keyMCP_SERVER_URL(optional) - Remote MCP server URL for component discoveryMCP_API_KEY(optional) - API key for remote MCP server
For enhanced component discovery, you can run a local MCP server:
pnpm dev:mcpOr use SSE mode:
pnpm dev:mcp:sseWe welcome contributions! Please see CONTRIBUTING.md for guidelines.
For detailed information about the architecture, data flow, and component system, see ARCHITECTURE.md.

This project is licensed under the MIT License - see the LICENSE file for details.
- shadcn/ui for the beautiful component library
- Google Gemini for the AI capabilities
- Next.js for the amazing framework
- Radix UI for accessible primitives
If you encounter any issues or have questions:
- Check the USAGE.md guide
- Review ARCHITECTURE.md for technical details
- Open an issue on GitHub
Built with ❤️ using Next.js and AI