1.0.0 • Published 3 years ago

guaiamum-dmt-ka-slider v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Image Caroussel Slider

Using scrollBy API this component receives the following props:

  1. images: Required. Set of image src and alt to be rendenred. Should come in the format: {src:'path/to/image', desc:'Image's alt text'}
  2. width = 300. Image width, to avoid CLS.
  3. height = 150. Image height, to avoid CLS.
  4. loadFirst = 1. number of images that should not be lazyloaded. Any image beyond this number is going to use the IntersectionObserver API to be lazy loaded. Unfortunately loading lazy is not mature enough to support horizontal scrolling.

This component also uses scroll snapping so on mobile there's no need to use the prev/next buttons.

Package is provided not bundled, use your own bundling solution :)

Known Issues

  • Observer script not tested
  • No RTL support on desktop