The SharePoint framework (SPFx) is a newly-revealed technology by Microsoft which works as a client-side model and supports open source tools. It is mostly recommended for SharePoint online.
Galleries are used to display the images/photos in thumbnail grid or layouts or a carousel which can be scrolled through to view images one by one.
Since we are developers, we could create e-commerce web application like Amazon or Flipkart. This type of application mainly plays with images/photos. So, we need to put extra concentration into displaying images and displaying multiple images in one layout.

The features of this component
- Image preview
- Full-screen image
- Image scrolling
- Previous and next arrows
Let us take you through step by step with sample code.
Step 1
We need to install font-awesome. Use the below command to install.
npm install font-awesome --save
Note
This tool uses some icons like a forward arrow and backward arrow. The icons are referred from font-awesome.
Step 2
Now, we are going to install ngx-gallery in your project using the below command.
npm install ngx-gallery --save
Step 3
Register ngx-gallery in app module on providers array.
- import { NgxGalleryModule } from 'ngx-gallery';
- ...
- @NgModule({
- imports: [
- ...
- ...
- ],
- providers:[NgxGalleryModule ]
- ...
- })
- export class AppModule { }
Step 4
Import in your component. Here, I am using In-App.component.
- // app.component.ts
- import { Component, OnInit } from '@angular/core';
- import { NgxGalleryOptions, NgxGalleryImage, NgxGalleryAnimation } from 'ngx-gallery';
- ...
- @Component({
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.scss'],
- })
Here, I am using two arrays - one for the look and feel and the other one for image source.

bishoe nbPosted Jan 1, 2020, 4:43 PM
How can you send a full array to the exhibition for display?
Muthu KumarPosted Jul 21, 2018, 2:29 AM
Nice Article clearly Explained, Thanks for sharing.
Viknaraj ManogararajahPosted Jul 14, 2018, 10:47 PM
Nice Article, Thank you for sharing.........
Hadshana KamalanathanPosted Jul 14, 2018, 7:03 PM
Thanks for sharing
Ravishankar NPosted Jul 13, 2018, 1:08 PM
Nice article. thanks for sharing