All Projects → avivharuzi → ngx-glide

avivharuzi / ngx-glide

Licence: MIT license
Angular wrapper component of Glide carousel library

Programming Languages

typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
shell
77523 projects

Projects that are alternatives of or similar to ngx-glide

vue-m-carousel
vue 移动端轮播组件
Stars: ✭ 53 (+140.91%)
Mutual labels:  carousel
angular-open-source-starter
This is a starter project for creating open-source libraries for Angular. It is a full fledged Angular workspace with demo application and easy library addition. It is designed to be used for open-sourcing libraries on Github and has everything you'd need ready for CI, code coverage, SSR testing, StackBlitz demo deployment and more.
Stars: ✭ 212 (+863.64%)
Mutual labels:  angular-library
skeleton-carousel
Carousel component. Horizontal and vertical swipe navigation
Stars: ✭ 31 (+40.91%)
Mutual labels:  carousel
react-spring-carousel-js
A new Carousel experience for the modern Web
Stars: ✭ 82 (+272.73%)
Mutual labels:  carousel
pinar
🌲☀️ Customizable, lightweight React Native carousel component with accessibility support.
Stars: ✭ 214 (+872.73%)
Mutual labels:  carousel
react-native-carousel-component
React Native Carousel Component for IOS & Android
Stars: ✭ 61 (+177.27%)
Mutual labels:  carousel
SimpleSlider
Simple responsive slider created in pure javascript.
Stars: ✭ 21 (-4.55%)
Mutual labels:  carousel
TravellingApp
Xamarin.Forms goodlooking UI sample using the new CarouselView.
Stars: ✭ 52 (+136.36%)
Mutual labels:  carousel
AndroidSliderViewsLibrary
AndroidSliderViewsLibrary is an Android SDK library supports vertical & horizontal carousel and slideshow Views which developers simply integrate on Android project. - by @sung2063
Stars: ✭ 33 (+50%)
Mutual labels:  carousel
ngx-slick-carousel
Angular 11+ wrapper for slick plugin
Stars: ✭ 82 (+272.73%)
Mutual labels:  carousel
react-imageViewer
React component for image displaying in full screen
Stars: ✭ 61 (+177.27%)
Mutual labels:  carousel
ng-stack
This Angular library contains several projects: forms, api-mock, contenteditable.
Stars: ✭ 132 (+500%)
Mutual labels:  angular-library
react-cool-virtual
😎 ♻️ A tiny React hook for rendering large datasets like a breeze.
Stars: ✭ 1,031 (+4586.36%)
Mutual labels:  carousel
stimulus-carousel
A Stimulus controller to deal with carousel.
Stars: ✭ 22 (+0%)
Mutual labels:  carousel
vue-piece-slider
animated slides in a fragmented look 🐞🌳✡️📐
Stars: ✭ 95 (+331.82%)
Mutual labels:  carousel
v-owl-carousel
🦉 VueJS wrapper for Owl Carousel
Stars: ✭ 46 (+109.09%)
Mutual labels:  carousel
svelte-slidy
📸 Sliding action script
Stars: ✭ 211 (+859.09%)
Mutual labels:  carousel
svelte-commerce
Svelte ecommerce - Headless, Authentication, Cart & Checkout, TailwindCSS, Server Rendered, Proxy + API Integrated, Animations, Stores, Lazy Loading, Loading Indicators, Carousel, Instant Search, Faceted Filters, Typescript, Open Source, MIT license. 1 command deploy to your own server, 1 click deploy to netlify.
Stars: ✭ 695 (+3059.09%)
Mutual labels:  carousel
SRCarouselView
A carousel view that only uses two UIImageView to achieve infinite carousel.
Stars: ✭ 56 (+154.55%)
Mutual labels:  carousel
vue-carousel
Infinite image carousel built with Vue.js
Stars: ✭ 43 (+95.45%)
Mutual labels:  carousel

ngx-glide

Angular wrapper component of Glide carousel library.

npm NPM npm bundle size

Environment Support

  • Angular 6+
  • Server-side Rendering

Compatibility

Versions compatibility list:

ngx-glide Angular @glidejs/glide
14.x.x 14.x.x 3.x.x
13.x.x 13.x.x 3.x.x
12.x.x 12.x.x 3.x.x
11.x.x 11.x.x 3.x.x
10.x.x 10.x.x 3.x.x
1.x.x 6.x.x - 9.x.x 3.x.x

Installation

npm i @glidejs/glide@3 ngx-glide

Demo

Demo page

Usage

Add scss files to the styles section of your angular.json:

"styles": [
  "src/styles.scss",
  "node_modules/@glidejs/glide/src/assets/sass/glide.core",
  "node_modules/@glidejs/glide/src/assets/sass/glide.theme"
],

You can either import the styles files into main scss file:

@import '~@glidejs/glide/src/assets/sass/glide.core';
@import '~@glidejs/glide/src/assets/sass/glide.theme';

Import NgxGlideModule into the current module's imports:

import { NgxGlideModule } from 'ngx-glide';

imports: [
  // ...
  NgxGlideModule,
],

Use in your components (add html items into the ngx-glide component):

<ngx-glide>
  <div>0</div>
  <div>1</div>
  <div>2</div>
</ngx-glide>

You can also access to the component instance directly like this:

// Get the component instance.
@ViewChild(NgxGlideComponent, { static: false }) ngxGlide: NgxGlideComponent;

play(): void {
  this.ngxGlide.play();
}

Update the carousel items dynamically (only available from version 12).

<ng-container *ngIf="names && names.length > 0">
  <ngx-glide #ngxGlide>
    <ng-container *ngFor="let name of names">
      <div>{{ name }}</div>
    </ng-container>
  </ngx-glide>
</ng-container>
// Get the component instance.
@ViewChild('ngxGlide') ngxGlide!: NgxGlideComponent;

names: string[];

constructor() {
  this.names = ['Johny Depp', 'Christian Bale'];
}

updateItems(): void {
  this.names = [...this.names, 'Tom Hanks'];
  if (this.ngxGlide) {
    this.ngxGlide.recreate();
  }
}

API

Inputs

Input Type Default Description
showArrows boolean true Indicates if to show arrows in the view or not.
showBullets boolean true Indicates if to show bullets in the view or not.
arrowLeftLabel string 'prev' The label presented in the arrow left side.
arrowLeftTemplate TemplateRef null Custom HTML (TemplateRef) to use for arrow left this disable the default.
arrowRightLabel string 'next' The label presented in the arrow right side.
arrowRightTemplate TemplateRef null Custom HTML (TemplateRef) to use for arrow right this disable the default.
listenToEvents boolean false If you need to get output events set it to true (by default is false to save performance).
type string 'slider' Type of the movement.
startAt number 0 Start at specific slide number.
perView number 1 A number of visible slides.
focusAt number | string 0 Focus currently active slide at a specified position.
gap number 10 A size of the space between slide.
autoplay number | boolean false Change slides after a specified interval.
hoverpause boolean true Stop autoplay on mouseover.
keyboard boolean true Change slides with keyboard arrows.
bound boolean false Stop running perView number of slides from the end.
swipeThreshold number | boolean 80 Minimal swipe distance needed to change the slide.
dragThreshold number | boolean 120 Minimal mousedrag distance needed to change the slide.
perTouch number | boolean false A maximum number of slides moved per single swipe or drag.
touchRatio number 0.5 Alternate moving distance ratio of swiping and dragging.
touchAngle number 45 Angle required to activate slides moving.
animationDuration number 400 Easing function for the animation.
rewind boolean true Allow looping the slider type.
rewindDuration number 800 Duration of the rewinding animation.
animationTimingFunc string 'cubic-bezier(0.165, 0.840, 0.440, 1.000)' Easing function for the animation.
direction string 'ltr' Moving direction mode.
peek number | object 0 The value of the future viewports which have to be visible in the current view.
breakpoints object {} Collection of options applied at specified media breakpoints.
throttle number 25 Throttle costly events

Outputs

Output Event Type Example Description
mountedBefore void Called before first mounting begins. However, the mounting phase has not been started, and components are not bootstrapped yet.
mountedAfter void Called right after first mounting. All components have been mounted.
updated void Called right after updating settings with update() API method.
played void Called right after starting an instance with play() API method.
paused void Called right after stopping instance with pause() API method.
buildedBefore void Called right before setting up a slider to its initial state. At this point, classes, translations, and sizes are applied.
buildedAfter void Called right after setting up a slider to its initial state. At this point, classes, translations, and sizes are applied.
ranBefore object { "direction": ">", "steps": 0 } Called right before calculating new index and making a transition. The movement schema (eg. =1) string has been parsed.
ran object { "direction": ">", "steps": 0 } Called right after calculating new index and before making a transition. The movement schema (eg. =1) string has been parsed.
ranAfter object { "direction": ">", "steps": 0 } Called after calculating new index and making a transition. The movement schema (eg. =1) string has been parsed.
ranOffset object { "direction": ">", "steps": 0 } Called after calculating new index and making a transition, while we did an offset animation. Offset animation take place at two moments.
runStarted object { "direction": ">", "steps": 0 } Called right after calculating the new index, but before making a transition, while we did a rewinding to the start index.
runEnded object { "direction": ">", "steps": 0 } Called right after calculating the new index, but before making a transition, while we did a rewinding to the last index.
moved object { "movement": 0 } Called right before movement transition begins.
movedAfter object { "movement": 0 } Called right after movement transition ends.
resized void Called when the window is being resized. This event throttled.
swipeStarted void Called right after swiping begins.
swipeMoved void Called during swiping movement.
swipeEnded void Called right after swiping ends.
translateJumped object Called right before a translate applies, while we doing a jump to the first or last slide from offset movement. This event is only used when a type is set up to carousel.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].