# Content Gallery

## Usage

**app.html**

```markup
<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**

```typescript
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**

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

## Gallery styling properties

|         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.                                                                                                            |

## Gallery output properties

|      Attr     | Details                                                                                   |
| :-----------: | ----------------------------------------------------------------------------------------- |
| onCardChanged | This event emitter is fired when card was changed and as parameter send that active card. |

## Gallery card styling properties

|         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**.   |

## Gallery card output properties

|  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. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cedrus.gitbook.io/project-fusion/components/basic/content-gallery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
