sliceit
Version:
A CLI tool to generate React components with custom templates (JS, JSX, TSX, CSS, SCSS, Styled Components)
93 lines (61 loc) โข 2.17 kB
Markdown
# ๐งฉ sliceit โ React Component Generator CLI
**sliceit** is a lightweight and powerful CLI tool for generating complete React component slices โ including JSX, CSS, and optional test files โ in seconds.
Save time, stay consistent, and boost your productivity while building modern React apps.
## ๐ Features
- ๐ง Quickly scaffold React components
- ๐จ Includes a CSS file with basic structure
- ๐งช Optionally generate a Jest/RTL test
- ๐ Creates everything in its own component folder
- ๐ก Easy to use, minimal setup
## ๐ฆ Installation
```bash
npm install -g sliceit
```
## ๐ ๏ธ Usage
```bash
sliceit create <ComponentName> [--jsx | --tsx | --js] [--css | --scss | --styled] [--with-test]
```
```bash
sliceit create <ComponentName> - this asks for prompt creation
```
## ๐ Notes
- ๐ The component folder will be created **in the current working directory**.
- โ
Make sure you're in the correct folder before running the command.
## ๐ Example
```bash
sliceit create Button --jsx --styled --with-test
```
Generates:
```
Button/
โโโ Button.jsx
โโโ Button.styled.js
โโโ __tests__/
โ โโโ Button.test.jsx
```
## โ๏ธ Configuration
You can optionally configure sliceit with a config file in your project root to avoid passing flags each time.
โ Example: sliceit.config.json
```
{
"template": "tsx",
"style": "scss",
"withTest": true
}
```
Default command will pick up tags from config file. If there is no config file it will start default prompt.
```bash
sliceit create Button
```
## ๐ Support
If you find **SliceIt** helpful, consider supporting its development:
[](https://buymeacoffee.com/elpajone)
Thank you for your support!
## ๐ง Future Plans
๐๏ธ Choose between different folder structures or templates
๐ฆ Component export indexing
๐งฉ VS Code Extension
๐ Plugin system for advanced customization
๐ Storybook generation (planned for v2)