0.0.12 • Published 6 months ago

@iladiro/angular-slider v0.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

IladiroAngularSliderLibrary Documentation

This library is compatible with Angular versions >=15.0.0

Note: Please use version from 0.0.12, which is compatible with Angular versions >=15.0.0, older versions are only compatible with Angular version ^15.2.0. It was my mistake! Thank you

Angular Slider plugin is flexible and easily customizable

Description

You can use the default template or pass your custom template following some configurations.

Alt text

Before start

  1. npm i @iladiro/angular-slider
  2. Import IladiroAngularSliderLibraryModule into your module from import { IladiroAngularSliderLibraryModule } from '@iladiro/angular-slider';

Getting Setup

Use <iladiro-angular-slider></iladiro-angular-slider> selector to show the slider

Note: The example below shows the mandatory data! Slider Widget accept only Slide object type array.

<iladiro-angular-slider [slideList]="list"></iladiro-angular-slider>

Note: As default I used font awesome icons, but you can use which icons you prefer

Interface

Convert your array in an Slide object array. As you can see, all properties are not required. Import IladiroAngularSlide from import { IladiroAngularSlide } from '@iladiro/angular-slider/lib/interfaces/slide.interface';

interface IladiroAngularSlide {
    link?: string;
    mediaSrc?: string;
    tag?: string;
    title?: string;
    description?: string;
    cta?: string;
}

Examples

Note: Default template

<pre>
    ```
    <iladiro-angular-slider
        [slideList]="list">
    </iladiro-angular-slider>
    ```
</pre>

Note: Custom template

<pre>
    ```
    <iladiro-angular-slider
        [slideList]="list">
        [maxVisibleSlides]="2"
        [paginatorArrowNext]="'fa fa-arrow-circle-o-right fa-4x'"
        [paginatorArrowPrev]="'fa fa-arrow-circle-o-left fa-4x'"
        [paginatorTemplate]="'templateOne'">
    </iladiro-angular-slider>
    ```
</pre>

Note: Custom dynamic template

<pre>
    ```
    <iladiro-angular-slider
        [maxVisibleSlides]="1"
        [paginatorArrowNext]="'fa fa-arrow-circle-o-right fa-4x'"
        [paginatorArrowPrev]="'fa fa-arrow-circle-o-left fa-4x'"
        [paginatorTemplate]="'templateOne'"
        [slideList]="list">
        <ng-template
            #customTemplate
            let-slide="slide"
            let-first="first"
            let-last="last"
            let-index="index"
            let-activeIndex="activeIndex"
            let-direction="direction">
            <your-template
                [slide]="slide"
                [index]="index"
                [activeIndex]="activeIndex"
                [first]="first"
                [last]="last"
                [direction]="direction">
            </your-template>
        </ng-template>
    </iladiro-angular-slider>
    ```
</pre>

Paginator

You can choose which type of paginator to use, there are three different types.

  • default
  • templateOne
  • templateTwo

Options

Other options are available besides the mandatory ones

propertytyperequireddefaultnotes
slideListArray<IladiroAngularSlide>yesundefinedThis widget expect a list of Slide to show it.
maxVisibleSlidesNumbernoundefinedYou can choose how many slides to show at a time
paginatorTemplateStringnodefaultYou can choose which type of pagination you want to use between: default, templateOne, templateTwo
paginatorArrowStartStringnofa fa-angle-double-leftYou can change the arrow that jumps to the first item in the list
paginatorArrowEndStringnofa fa-angle-double-rightYou can change the arrow that jumps to the last item in the list
paginatorArrowNextStringnofa fa-chevron-rightYou can change the arrow that goes to the next item
paginatorArrowPrevStringnofa fa-chevron-leftYou can change the arrow that moves to the previous item
paginatorMaxVisiblePagesNumberno5If you were to use the templateTwo template, you might need this option, i.e. it allows you to tell the paginator that you want to display maximum n numbers of pages
customClassStringnoundefinedYou can also pass a class or a list of classes to add to the parent slide tag. It can be useful, for example, to use the default card but customize it specifically for that section
clickableSlidebooleannofalseSet if slide is clickable or not. If set on true css cursor is type pointer

Events

Event nameReturnDescriptionExample
goNextEventObject Es. {page: 2, direction: 'next'}Allows you to capture the event when the pager is used to move to the next slide<iladiro-angular-slider (goNextEvent)="console.log($event)"></iladiro-angular-slider>
goPrevEventObject Es. {page: 2, direction: 'prev'}Allows you to capture the event when the pager is used to move to the previous slide<iladiro-angular-slider (goPrevEvent)="console.log($event)"></iladiro-angular-slider>
goFirstEventObject Es. {page: 2, direction: 'first'}Allows you to capture the event when the pager is used to return to the first slide<iladiro-angular-slider (goFirstEvent)="console.log($event)"></iladiro-angular-slider>
goLastEventObject Es. {page: 2, direction: 'last'}Allows you to capture the event when the pager is used to go to the last slide<iladiro-angular-slider (goLastEvent)="console.log($event)"></iladiro-angular-slider>
clickSlideEventObject of IladiroAngularSlideAllows you to capture the event when user click on Slide<iladiro-angular-slider (clickSlideEvent)="console.log($event)"></iladiro-angular-slider>
0.0.12

6 months ago

0.0.11

6 months ago

0.0.10

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago