AI Voice Component Builder is a conversational UI generation app that turns spoken or typed product ideas into production-ready React components. It combines a live Gemini-based generation flow with a preview surface so you can describe a component, iterate on it in real time, and copy the result into your app.
- Accepts natural language component requests
- Supports voice-driven prompt creation for faster iteration
- Also supports written prompts for precise control
- Streams Gemini responses live as the model generates
- Cleans the model output into usable JSX
- Renders the generated component in an isolated preview
- Lets you switch between preview and code views
- Supports copying the generated component code
- Build marketing components from a voice prompt
- Generate UI cards, forms, dashboards, and pricing sections
- Rapidly prototype interface ideas without switching tools
- Explore multiple design directions in a conversational workflow
- You enter a prompt by typing or speaking a component idea.
- The app sends the request to Gemini Live.
- Gemini streams the generated JSX back in real time.
- The app cleans and normalizes the output.
- The preview panel renders the component in a sandboxed frame.
- You inspect the code, copy it, or refine the prompt.
- Live generation streaming
- Voice-first prompt workflow
- React + Tailwind output
- Code preview and rendered preview
- Copy-to-clipboard support
- Local API key storage in the browser
- Error handling for empty or invalid responses
Next.jsfor the application shell and routingReactfor the UITypeScriptfor type safetyTailwind CSSfor styling@google/genaifor Gemini Live integration- Web Speech API or a custom audio capture layer for voice input
The frontend is responsible for:
- Prompt entry and voice capture
- Live chat-style state updates
- Rendering generated components
- Displaying code and preview modes
The AI layer handles:
- Gemini Live session creation
- Streaming response handling
- Prompt formatting for component generation
- JSX cleanup and validation
The preview layer handles:
- Isolated rendering of generated JSX
- Safe execution in a sandboxed frame
- Error fallback when the component fails to render
Use a local .env.local file for secrets.
GEMINI_API_KEY=your_gemini_api_keyIf you use Firebase or other services later, add those keys here as well.
npm installCreate .env.local and add your Gemini API key.
npm run devnpm run buildnpm run lintFor the voice experience, the user can:
- Hold a mic button and speak a request
- Dictate a component description
- Ask for changes such as color, layout, spacing, or content
- Refine the output through short follow-up voice prompts
You can also use the app like a normal prompt-to-component builder:
- Type a component request in the prompt box
- Generate a component from a short or detailed brief
- Refine it with follow-up typed prompts
- Compare the code and preview side by side
Example prompts:
- "Create a dark pricing card with a monthly and yearly toggle"
- "Make a sleek profile card with avatar, stats, and social links"
- "Generate a landing page hero with a CTA and abstract background"
- "Build a compact dashboard summary card with three metrics"
- Be specific about the component type
- Mention layout, theme, and style direction
- Include desired content and interactions
- Ask for one component at a time
- Use follow-up prompts to refine the result
Example:
Create a modern voice assistant card with a waveform, status text, and action buttons. Use a dark theme and soft gradients.
- The generated output should be raw JSX, not a full page
- Tailwind classes are preferred for styling consistency
- The preview should stay isolated from the main UI
- The app should handle partial streamed output gracefully
- A backend proxy is recommended if you want to keep keys private in production
- Do not expose long-lived API keys directly in the browser for production
- Prefer a backend endpoint or ephemeral token flow for live AI sessions
- Store only non-sensitive user preferences locally
- Voice capture and playback
- Conversation history
- Component versioning
- Saved component gallery
- Export to Next.js / React files
- Backend auth and secure token exchange
- Multi-turn refinement with prompt memory
- Image or screenshot-based UI generation
Add your preferred license here before publishing the project.
This project is intended to be a fast, voice-first component ideation tool powered by Gemini Live. It focuses on turning spoken ideas into clean React UI with a minimal feedback loop between prompt, generation, and preview.