A CLI tool to generate React Native components and screens with predefined structure. Quickly scaffold files with consistent naming conventions.
npm install rnc-generatorA CLI tool to generate React Native components and screens with predefined structure. Quickly scaffold files with consistent naming conventions.
- Generates both Components (c) and Screens (s)
- Creates three standard files:
- .tsx component file
- .tsx styles file
- .ts types file
- Reduces manual setup time for new UI elements
Install globally for system-wide access:
``sh`
npm install -g rnc-generator
`sh`
rnc-generator
`sh`
rnc-generator Button cor (since 'c' is default)
rnc-generator Button
Output:
``
ButtonComponent/
├── Button.component.tsx
├── Button.styles.tsx
├── Button.types.ts
`sh`
rnc-generator Home s
Output:
``
HomeScreen/
├── Home.screen.tsx
├── Home.styles.tsx
├── Home.types.ts
Both components and screens generate:
- Main File: Name.[component|screen].tsxName.styles.tsx
- Styles: Name.types.ts
- Types:
Generate a Profile screen:
`sh`
rnc-generator Profile s
Creates:
``
ProfileScreen/
├── Profile.screen.tsx
├── Profile.styles.tsx
├── Profile.types.ts
Developed by Daniyal Shah
MIT Licensed
---
1. Clearly explains the c/s` parameter in the Usage section
2. Shows both component and screen generation examples
3. Maintains your clean, minimal style
4. Preserves all your original sections (Author, License)
5. Uses consistent terminology ("Component"/"Screen") throughout