A CLI tool written in Rust to quickly generate React component boilerplate code.
- 🚀 Fast component generation
- 📝 TypeScript and JavaScript support
- 🎨 Pre-configured component templates
- 🪝 Custom hook templates (coming soon)
- ⚡ Built with Rust for performance
- Rust (install from rustup.rs)
git clone <repository-url>
cd basic-rust
cargo build --releaseThe compiled binary will be in target/release/
cargo run -- MyComponentCreates ./src/components/MyComponent.tsx:
import React from 'react';
interface MyComponentProps {
children?: React.ReactNode;
}
export const MyComponent: React.FC<MyComponentProps> = ({ children }) => {
return (
<div className="MyComponent">
{children}
</div>
);
};cargo run -- MyComponent --jsCreates ./src/components/MyComponent.jsx
| Option | Short | Description |
|---|---|---|
component |
- | Name of the component to generate (required) |
--js |
-j |
Generate JavaScript instead of TypeScript |
# TypeScript component
cargo run -- Button
# JavaScript component
cargo run -- Header --js
cargo run -- Footer -jbasic-rust/
├── src/
│ ├── main.rs # CLI application
│ └── components/ # Generated components output here
├── Cargo.toml
└── README.md
clap- Command line argument parsing
- Basic component generation
- TypeScript/JavaScript support
- Custom hook generation
- Multiple component templates
- Custom output directory option
- Unit tests
Contributions are welcome! Feel free to open issues or submit pull requests.
MIT
Built with ❤️ using Rust