Modern Angular image cropper library built on CropperJS with enhanced configuration architecture and optional built-in toolbar.
- 📚 Documentation & API - Complete Storybook documentation
- 🎮 Live Playground - Interactive demo
- 📦 NPM Package - Install the library
- 📋 Changelog - Release notes and updates
- 🎯 Zero Dependencies - Built-in SVG icons, no external icon libraries required
- ⚡ Modern Angular - Supports Angular 17.1+ with latest features
- 🎨 Highly Customizable - Comprehensive configuration objects for every component
- 🛠️ Built-in Toolbar - Optional toolbar with customizable icons and actions
- 📱 Responsive - Works seamlessly across all devices
- 💪 TypeScript Ready - Full type definitions and strict typing
- 🎛️ Flexible API - Both individual properties and config objects supported
npm install ng-cropper-lib
# or
pnpm add ng-cropper-lib
# or
yarn add ng-cropper-lib
import { Component } from '@angular/core';
import { NgCropper } from 'ng-cropper-lib';
@Component({
selector: 'app-demo',
imports: [NgCropper],
template: `
<ngCropper
[imageSrc]="'https://picsum.photos/800/600'"
[showToolbar]="true"
toolbarPosition="bottom"
[selectionInitialCoverage]="0.6"
/>
`
})
export class DemoComponent {}
This monorepo contains multiple packages and applications:
ng-cropper/
├── libs/ng-cropper/ # 📦 Main library package
│ ├── src/lib/ # Library source code
│ ├── README.md # Library documentation
│ └── package.json # NPM package configuration
├── apps/ng-cropper-playground/ # 🎮 Demo application
├── .github/workflows/ # 🚀 CI/CD automation
│ ├── deploy.yml # Deploy docs & demo
│ └── publish.yml # Publish to NPM
├── CHANGELOG.md # 📋 Release notes
└── README.md # This file
The main Angular library package published to NPM as ng-cropper-lib
.
- Source:
libs/ng-cropper/src/lib/
- Documentation: Storybook
- Package:
ng-cropper-lib
Interactive demo application showcasing the library features.
- Live Demo: ng-cropper-playground
- Source:
apps/ng-cropper-playground/src/
This project uses Nx for workspace management.
- Node.js 18+
- pnpm (recommended)
# Clone the repository
git clone https://github.com/DanielGabbay/ng-cropper.git
cd ng-cropper
# Install dependencies
pnpm install
# Start development playground
pnpm dev
# Start Storybook documentation
pnpm storybook
# Build library
pnpm build:lib
# Run tests
pnpm test:lib
# Lint code
pnpm lint
This project uses GitHub Actions for automated deployment:
- 📚 Documentation & Demo: Auto-deployed to GitHub Pages on every push to
master
- 📦 NPM Publishing: Auto-published when creating a GitHub release
# Build the library
pnpm build:lib
# Publish to NPM
cd dist/libs/ng-cropper
npm publish
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'feat: add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If NgCropper has been helpful to you, consider supporting its development:
Your support helps maintain and improve this project!
⭐ Star this project if you find it useful!