An open API service indexing awesome lists of open source software.

https://github.com/renamoo/ng-simple-carousel

Simple, responsive and customizable carousel component made with Angular
https://github.com/renamoo/ng-simple-carousel

angular carousel

Last synced: 2 months ago
JSON representation

Simple, responsive and customizable carousel component made with Angular

Awesome Lists containing this project

README

        

# ng-simple-carousel

A carousel component made with Angular 10. No other dependencies.
Focus on simple functionality, allowing easy-customize.
Responsive and mobile-frindly.

## Demo
You can check samples from [here](https://ng-simple-carousel.netlify.app/)

## Install
```
npm i ng-simple-carousel
```

## APIs

### NgSimpleCarouselComponent
| | Name | Type | |
|----|------------|----------------------|------------------------------------------------------|
| @Input | controller | [CarouselController](#carouselcontroller) | Class used to change component state programatically |
| @Input | images | [CarouselImage[ ]](#carouselimage) | Information of images on the slides |
| @Input | objectFit | "contain" \| "cover" | Set css object-fit property. Default is contain |
| @Output | imgChange | EventEmitter | Id of image emitted when active image is changed

### NgSimpleCarouselWithButtonComponent
| | Name | Type | |
|----|------------|----------------------|------------------------------------------------------|
| @Input | controller | [CarouselController](#carouselcontroller) | Class used to change component state programatically |
| @Input | images | [CarouselImage[ ]](#carouselimage) | Information of images on the slides |
| @Input | objectFit | "contain" \| "cover" | Set css object-fit property. Default is contain |
| @Output | imgChange | EventEmitter | Id of image emitted when active image is changed

### NgSimpleCarouselComponentWithDots
| | Name | Type | |
|----|------------|----------------------|------------------------------------------------------|
| @Input | controller | [CarouselController](#carouselcontroller) | Class used to change component state programatically |
| @Input | images | [CarouselImage[ ]](#carouselimage) | Information of images on the slides |
| @Input | objectFit | "contain" \| "cover" | Set css object-fit property. Default is contain |
| @Output | imgChange | EventEmitter | Id of image emitted when active image is changed

### CarouselController
| Name | Arg | |
|------------|----------------------|------------------------------------------------------|
| jumpTo() | id | Jump to the image of specified id |
| prev() | --- | Go to previous image |
| next() | --- | Go to next image |

### CarouselImage
| Name | Type | | |
|------------|------|----------------------|------------------------------------------------------|
| id | string | required | |
| src | string | required | |
| srcset | string | | |
| sizes | string | | |
| alt | string | | |
| sources | [CarouselImageSource [ ]](#carouselimagesource) | | |

### CarouselImageSource
| Name | Type | | |
|------------|------|----------------------|------------------------------------------------------|
| srcset | string | required | |
| type | string | | |
| sizes | string | | |