React component generator CLI
npm install react-gen-kitA powerful and flexible CLI tool to interactively generate React components, pages, hooks, or providers โ with full support for JavaScript or TypeScript, styles, testing, and configurable paths.
---
- ๐ง Interactive CLI (like Vite!)
- โ๏ธ Generate:
- React Components
- Pages
- Hooks
- Providers
- ๐ง Supports both JavaScript and TypeScript
- ๐จ Style file support (css, scss, with optional CSS Modules)
- ๐งช Optional test file using React Testing Library
- ๐ Custom output path or generate in the current directory
- ๐ ๏ธ Configurable via .componentclirc.json
---
`bash
npm install react-gen-kit
npx react-gen-kit [options] (For Custom Path and Current working directory)
Example 1: npx react-gen-kit -c
Example 2: npx react-gen-kit --path < your custom path >
`
`bash
Step 1: npm install react-gen-kit
Step 2: Add this to package.json scripts:
"scripts": {
"generate": "react-generate"
},
Step 3: Run this command in terminal "npm run generate [options]"
Example 1: npm run generate -c
Example 2: npm run generate -- --path < your custom path >
`
| Parameter | Type | Description |
| :---------------- | :-------- | :---------------------------------------------------------------------------- |
| --path,-p | string | Custom relative path to place the component (e.g. shared/ui) |--current
| ,-c | boolean | Generate the component inside a components/ folder in the current directory |