0.0.19 • Published 7 months ago

@snap-carousel/core v0.0.19

Weekly downloads
23
License
MIT
Repository
-
Last release
7 months ago

SimplebarReact

Installation

- Via npm npm install @snap-carousel/core --save

- Via Yarn yarn add @snap-carousel/core

Usage

Check out the Demo project or our live Codesandbox example.

If you are using a module loader (like Webpack) you first need to load SimpleBar:

import { getActiveSnap, scrollTo, dragToScroll } from '@snap-carousel/core';
import '@snap-carousel/core/dist/styles.css';

const root = document.querySelector('.carousel');

const activeSnap = getActiveSnap({
  root,
  onChange: (snapIndex) => {
    console.log('active snap changed to: ', snapIndex);
  },
});

const activeSnapIndex = activeSnap.getActiveIndex();

scrollTo({ root, index: 2, duration: 0 });

Don't forget to import both css and js in your project!

0.0.19

7 months ago

0.0.19-next.4

2 years ago

0.0.19-next.3

3 years ago

0.0.19-next.1

3 years ago

0.0.19-next.2

3 years ago

0.0.18-next.0

3 years ago

0.0.19-next.0

3 years ago

0.0.17

3 years ago

0.0.16

4 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago