A simple CLI tool for generating React components with a predefined folder structure and boilerplate code.
- Easily generate React components with a single command.
- Automatically creates the necessary folder structure.
- Generates .jsx and .css files with boilerplate code.
You can either clone the git or install with npm:
-
Clone the repository:
git clone https://github.com/mukundkumra/react-component-generator cd react-component-generator npm link
-
Install the package:
npm i -g @mukundkumra/react-component-generator
To generate a React component, use the command:
gen <ComponentName>
-
Generate a simple component:
gen Home
This will create the following structure:
Home/ ├── Home.jsx └── Home.css
-
Generate a nested component:
gen Test/Home
This will create the following structure:
Test/ └── Home/ ├── Home.jsx └── Home.css
import './Home.css';
import React from 'react';
function Home() {
return (
<div className="Home">
{/* Add your JSX here */}
</div>
);
}
export default Home;
.Home {
/* Add your styles here */
}
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.
This project is licensed under the MIT License - see the LICENSE file for details.