Content Gallery

Usage

app.html

<cf-content-gallery [styling]="galleryStyling">

    <cf-content-gallery-card *ngFor="let card of [1, 2, 3, 4, 5], let i = index">
        <h3 style="text-align: center">Card index: {{i}}</h3>
    </cf-content-gallery-card>

</cf-content-gallery>

app.ts

galleryStyling = new ContentGalleryStylingModel({
    height: '300px',
    verticalAlignment: 'center',
    horizontalAlignment: 'center',
    container: {class: 'my-gallery-container'},
    nextButton: {class: 'my-gallery-next-btn'},
    previousButton: {class: 'my-gallery-prev-btn'},
    paginationButton: {class: 'my-gallery-pagination-btn'}
});

galleryCardStyling = new ContentGalleryCardStylingModel({
    verticalAlignment: 'end',
    horizontalAlignment: 'end',
});

app.scss

/deep/ {
    .my-gallery-container {
        background: lightcyan;
    }
    .my-gallery-next-btn, .my-gallery-prev-btn, .my-gallery-pagination-btn {
        color: darkcyan;
    }
}

Attr

Type

Details

height

string

It is css height property. Logically work with values in pixels. If not set - gallery height will adjust to current card content height.

horizontalAlignment

string

It is horizontal alignment for all gallery cards. Can be: start, center, end. Card own horizontall alignmnent has higher importance.

verticalAlignment

string

It is vertical alignment. Can be: start, center, end. Card own vertical alignmnent has higher importance.

galleryInner

StylingModel

Standard styling StylingModel object.

nextButton

StylingModel

Standard styling StylingModel object.

previousButton

StylingModel

Standard styling StylingModel object.

galleryPagination

StylingModel

Standard styling StylingModel object.

paginationButton

StylingModel

Standard styling StylingModel object.

Attr

Details

onCardChanged

This event emitter is fired when card was changed and as parameter send that active card.

Attr

Type

Details

horizontalAlignment

string

It is horizontal alignment. Can be: start, center, end.

verticalAlignment

string

It is vertical alignment. Can be: start, center, end.

Attr

Details

onNext

This card event emitter is fired when gallery 'next arrow' was clicked to go to next card.

onPrev

This card event emitter is fired when gallery 'previuos arrow' was clicked to go to previous card.

Last updated