![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ngx-image-swiper
Advanced tools
A relatively simple component for displaying images in a container that can be navigated by mouse, touch and keyboard with no dependencies, other than Angular of course.
A relatively simple component for displaying images in a container that can be navigated by mouse, touch and keyboard events with no dependencies, other than Angular of course.
npm i ngx-image-swiper --save
Import NgImageSwiperModule
into the required module:
import { NgImageSwiperModule } from 'ngx-image-swiper';
@NgModule({
imports: [
NgImageSwiperModule
]
})
In your component:
import { Component } from '@angular/core';
import { NgxSwiperConfig } from 'ngx-image-swiper';
@Component({
selector: 'app-root',
template: `
<!-- put the component in a containing div -->
<div class="image-swiper">
<ngx-image-swiper [config]="swiperConfig" [images]="images"></ngx-image-swiper>
</div>
`,
styles: [
`
// position must be relative
// width & height can be whatever you want
.image-swiper {
position: relative;
width: 600px;
height: 600px;
}
`
]
})
export class AppComponent {
swiperConfig: NgxSwiperConfig = {
navigationPlacement: 'inside',
pagination: true,
paginationPlacement: 'outside'
};
images = [
'https://images.pexels.com/photos/2387869/pexels-photo-2387869.jpeg',
'https://images.pexels.com/photos/2395264/pexels-photo-2395264.jpeg',
'https://images.pexels.com/photos/2474014/pexels-photo-2474014.jpeg',
'https://images.pexels.com/photos/2440296/pexels-photo-2440296.jpeg',
'https://images.pexels.com/photos/2506269/pexels-photo-2506269.jpeg'
];
}
The component comes with two inputs, config
and images
.
Here you can pass in the configuration options you want to change from their defaults (explained below).
The array of images to pass into the swiper component.
Ngx-Image-Swiper comes with the following configuration options:
navigation?: boolean;
navigationPlacement?: 'inside' | 'outside';
navigationLeftIcon?: string;
navigationRightIcon?: string;
pagination?: boolean;
paginationPlacement?: 'inside' | 'outside';
imgBackgroundSize?: string;
border?: boolean;
borderRadius?: number;
swipeThreshold?: number;
loop?: boolean;
keyboardNavigation?: boolean;
navigation
Enable/disable left/right button navigation (will only show there is more than 1 image).
true
navigationPlacement
Where the navigation buttons should appear, outside the images or inside over the images.
'outside'
'inside' | 'outside
navigationLeftIcon
& navigationRightIcon
Overwrite the icons used for the background image of the left/right navigation buttons.
pagination
Enable/disable the pagination dots (will only show there is more than 1 image).
'true'
paginationPlacement
Where the pagination dots should appear, outside the images or inside over the images.
'outside'
'inside' | 'outside'
imgBackgroundSize
Sets the background-size
CSS property on the images
'cover'
border
Enable/disable a border around the images
'true'
borderRadius
Sets the border radius on the images. border
must be true also.
4
swipeThreshold
Sets a distance threshold images must be dragged to go to the previous/next image otherwise it will remain on the current image.
'50'
loop
Enable/disable looping of the images.
'true'
keyboardNavigation
Enable/disable capturing of the left/right arrow keys on the users keyboard to navigation the images.
'true'
There is just out output event, imageClick
which is fired when the user clicks on any given image. It outputs the index number of the image.
FAQs
A relatively simple component for displaying images in a container that can be navigated by mouse, touch and keyboard with no dependencies, other than Angular of course.
The npm package ngx-image-swiper receives a total of 18 weekly downloads. As such, ngx-image-swiper popularity was classified as not popular.
We found that ngx-image-swiper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.