# 🧩 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:

[![Buy Me A Coffee](https://img.shields.io/badge/Buy_Me_A_Coffee-yellow?logo=buy-me-a-coffee&style=flat-square)](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)
