Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

angular-custom-carousel

bassem-nabil1361.0.5TypeScript support: included

Angular-Custom-Carousel is A simple solution for carousel or slider. HTML is yours, it allows you to 100% customization on your css and html.

angular, angular2, angular4, angular5, angular6, angular7, angular8, angular9, angular10, angular11, angular12, angular13, angular-2, angular-4, angular-5, angular-6, angular-7, angular-8, angular-9, angular-10, angular-11, angular-12, angular-13, ng, ng2, ngx, ivy, thebassemnabil, bassCarouselInit, bassCarouselNext, bassCarouselPrevious, Angular carousel, Angular-carousel, angular2-carousel, angular13-carousel, angular10-carousel, angularcarousel, angularcarousel

readme

Angular Custom Carousel

Angular-Custom-Carousel is A simple solution for carousel or slider. HTML is yours, it allows you to 100% customization on your css and html.

you are not forced to use any styles.

Edit on StackBlitz ⚡️

Installation

Install the npm package.

  npm i angular-custom-carousel

Import module:

  import { NgCarouselModule } from 'angular-custom-carousel';

  @NgModule({
      imports: [
      NgCarouselModule
      .....
      ]
  })

Usage

  • add the directive selector (bassCarouselInit) on container div that have 'ul' and give it the inputs it need (carousalContainerClass, carousalULClass, carousalPreviousClass, carousalNextClass).

  • add Previous button and give it directive selector (bassCarouselPrevious) (carousalContainerClass, carousalULClass, carousalPreviousClass, carousalNextClass, pxPerClick)

  • add Next button and give it directive selector (bassCarouselNext) (carousalContainerClass, carousalULClass, carousalPreviousClass, carousalNextClass, pxPerClick)

    ex:

    <div class="mt-5">
    <div class="d-flex justify-content-center">
      <div class="d-flex  overflow-hidden demoContainer" style="width: 500px;height: 500px;" 
        bassCarouselInit [carousalContainerClass]="'demoContainer'" [carousalULClass]="'demoUL'" [carousalPreviousClass]="'demoprev'"
        [carousalNextClass]="'demonext'">
    
        <ul class="d-flex align-items-center bg-primary text-white demoUL overflow-hidden">
          <div style="min-width: 500px;">sliedr 1</div>
          <div style="min-width: 500px;">sliedr 2</div>
          <div style="min-width: 500px;">sliedr 3</div>
        </ul>
      </div>
    </div>
    <div class="d-flex justify-content-center">
      <button type="button" class="btn btn-warning mr-5 demoprev" 
      bassCarouselPrevious [carousalContainerClass]="'demoContainer'" 
      [pxPerClick]="250" [carousalULClass]="'demoUL'" [carousalPreviousClass]="'demoprev'" [carousalNextClass]="'demonext'">Previous</button>
    
      <button type="button" class="btn btn-warning demonext" 
      bassCarouselNext [carousalContainerClass]="'demoContainer'"
        [pxPerClick]="250" [carousalULClass]="'demoUL'" [carousalPreviousClass]="'demoprev'"
        [carousalNextClass]="'demonext'">Next</button>
    </div>
    </div>

Directive options ( inputs )

  • carousalContainerClass : container class of the div that hold the ul.
  • carousalULClass : class of ul.
  • carousalPreviousClass : class of the Previous button.
  • carousalNextClass : class of the Next button.
  • pxPerClick : the px you want to scroll (250 px to the left.. etc).