A command-line interface (CLI) tool to quickly generate React components with optional TypeScript support and CSS styles.
npm install create-new-react-component --save-dev
create-new-react-component <componentName> [options]
- --style : Create a style sheet file for the component, if no suffix is provided, the default is css
- --lang : Choose the file style (js or ts), if no language is provided, the default is js
For more information, run the following command:
create-new-react-component --help
or
create-new-react-component -h
to see the help message.
# Create a JavaScript component with default options
create-new-react-component MyComponent
# Create a JavaScript component with scss styles
create-new-react-component MyComponent --style scss
# Create a TypeScript component with other default options
create-new-react-component MyComponent --lang ts
# Create a TypeScript component with scss styles
create-new-react-component MyComponent --style scss --lang ts
- A simple, customizable utility for adding new React components to your project.
- Delightful React File/Directory Structure
Here are the planned features and improvements:
- TypeScript Support
- Extended Component Template Options
- Enhanced Styling Support
- Storybook Integration
- Automated Test File Generation
- CLI Interaction Improvements
- Basic Component Generation
- CSS Module Support
For detailed development plans, please check our GitHub Projects page.