@snap-carousel/core
TypeScript icon, indicating that this package has built-in type declarations

0.0.19-next.4 • Public • Published

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!

Readme

Keywords

none

Package Sidebar

Install

npm i @snap-carousel/core

Weekly Downloads

73

Version

0.0.19-next.4

License

MIT

Unpacked Size

164 kB

Total Files

31

Last publish

Collaborators

  • gromy