React Component Generator Pro
Professional React component generator by EonMirth
Professional React component generator for VS Code with professional scaffolding, smart features, and a powerful template system.
✨ Features
🚀 Component Scaffolding
- Generate TypeScript or JavaScript React components
- Choose between Functional or Class components
- Automatic PropTypes/Props interface inclusion
- Support for CSS, SCSS, CSS Modules, and Styled Components
📁 File Structure Generation
- Creates organized component folders
- Generates
index.tsx for barrel exports
- Includes
component.tsx with your template
- Adds
styles file in your preferred format
- Creates
test.tsx with React Testing Library setup
- Generates
.stories.tsx for Storybook integration
🎨 Premium Templates
10+ built-in templates included:
- Functional Component - Modern React with hooks
- Class Component - Traditional class-based component
- Material-UI Component - Pre-configured MUI button
- Ant Design Component - Ant Design card component
- Form Component - Form with state management
🔄 Template System
- Save custom templates from your components
- Share templates via GitHub Gist
- Import templates from the community
- Browse all templates in one place
🎯 Smart Features
- Framework Detection - Auto-detects Next.js, Gatsby, Vite, CRA
- PascalCase Validation - Ensures proper component naming
- Performance Monitoring - Generates components in < 2 seconds
- Progress Indicators - Visual feedback during generation
📦 Installation
From Marketplace (Coming Soon)
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "React Component Generator Pro"
- Click Install
From VSIX (Current)
- Download the
.vsix file
- Open VS Code
- Extensions > ... > Install from VSIX
🚀 Quick Start
- Right-click any folder in Explorer
- Select "React: Generate Component"
- Follow the prompts
Method 2: Command Palette
- Press
Ctrl+Shift+P (Windows) or Cmd+Shift+P (Mac)
- Type "React: Generate Component"
- Configure your component
🎮 Usage
Generate a Component
1. Component Name: MyButton (PascalCase)
2. Component Type: Functional / Class
3. Language: TypeScript / JavaScript
4. Style Type: CSS / SCSS / CSS Modules / Styled Components
5. Options:
✓ Include Props Interface
✓ Include Tests
☐ Include Storybook
Result:
MyButton/
├── index.ts
├── MyButton.tsx
├── MyButton.module.css
├── MyButton.test.tsx
└── MyButton.stories.tsx (if selected)
Template Commands
| Command |
Description |
React: Create Template |
Save current file as custom template |
React: Browse Templates |
View all available templates |
React: Share Template |
Export template to GitHub Gist |
React: Import Template |
Import template from Gist URL |
React: Delete Custom Template |
Remove a custom template |
⚙️ Configuration
Access settings via File > Preferences > Settings and search for "React Generator Pro":
| Setting |
Default |
Description |
reactGeneratorPro.defaultLanguage |
TypeScript |
Default component language |
reactGeneratorPro.defaultStyleType |
CSS Modules |
Default style format |
reactGeneratorPro.includePropTypes |
true |
Include props interface by default |
reactGeneratorPro.autoOpenPreview |
true |
Auto-open preview after generation |
reactGeneratorPro.templateStorage |
global |
Where to store custom templates |
🎯 Supported Frameworks
- ✅ Next.js - Auto-adds 'use client' directive
- ✅ Gatsby - Framework-specific configurations
- ✅ Vite - Optimized for Vite projects
- ✅ Create React App - Traditional CRA support
📚 Examples
Material-UI Component
import React from 'react';
import { Button, ButtonProps } from '@mui/material';
interface MyButtonProps extends Omit<ButtonProps, 'variant'> {
variant?: 'text' | 'outlined' | 'contained';
}
const MyButton: React.FC<MyButtonProps> = ({
variant = 'contained',
children,
...props
}) => {
return (
<Button variant={variant} {...props}>
{children || 'MyButton'}
</Button>
);
};
export default MyButton;
Includes state management, validation, and submission handling out of the box!
🤝 Contributing
We welcome template contributions! Share your templates via GitHub Gist:
- Create a unique component structure
- Use
React: Create Template
- Use
React: Share Template
- Share the Gist URL with the community
📄 License
MIT License - feel free to use in your projects!
🐛 Issues & Feedback
Found a bug or have a feature request?
- File an issue on GitHub
- Contact: [your-email@example.com]
🎉 What's Next?
Coming soon:
- 🎨 Visual Preview Panel
- 📝 Props Editor with real-time updates
- 📸 Export component as PNG
- 🧠 Smart import auto-detection
- ↩️ Undo/Redo support
Made with ❤️ for React developers
Generate components, not boilerplate!