sliceit
A CLI tool to generate React components with custom templates (JS, JSX, TSX, CSS, SCSS, Styled Components)
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.
- ๐ง 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
npm install -g sliceit
sliceit create <ComponentName> [--jsx | --tsx | --js] [--css | --scss | --styled] [--with-test]
sliceit create <ComponentName> - this asks for prompt creation
- ๐ The component folder will be created in the current working directory.
- โ Make sure you're in the correct folder before running the command.
sliceit create Button --jsx --styled --with-test
Generates:
Button/
โโโ Button.jsx
โโโ Button.styled.js
โโโ __tests__/
โ โโโ Button.test.jsx
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.
sliceit create Button
If you find SliceIt helpful, consider supporting its development:
Thank you for your support!
๐๏ธ Choose between different folder structures or templates
๐ฆ Component export indexing
๐งฉ VS Code Extension
๐ Plugin system for advanced customization
๐ Storybook generation (planned for v2)