🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

next-owl-carousel

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-owl-carousel

Next Owl Carousel

1.0.9
latest
Source
npm
Version published
Weekly downloads
5
-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

1.Installation

npm install --save next-owl-carousel
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css"/>
import { useRef } from 'react';
import OwlCarousel from 'next-owl-carousel';

2.Usage

const carouselRef = useRef(null);
const options = {
  loop: true,
  responsiveClass: true,
  dots: false,
  autoplay: true,
  responsive: {
    0: { items: 1, dots: true },
    768: { items: 2 },
  },
};
const events = {
  onDragged: function (event) {
    console.log('====onDragged===>>', event);
  },
  onChanged: function (event) {
    console.log('====onChanged===>>', event);
  },
};
<OwlCarousel ref={carouselRef} options={options} events={events} className="owl-carousel">
  <div className="item"><img src="/img/fullimage1.jpg" alt="item1" /></div>
  <div className="item"><img src="/img/fullimage1.jpg" alt="item2" /></div>
  <div className="item"><img src="/img/fullimage1.jpg" alt="item3" /></div>
</OwlCarousel>

3. Methods

Previous

<button onClick={() => carouselRef?.current?.prev()}>prev</button>

Next

<button onClick={() => carouselRef?.current?.next()}>prev</button>

goTo(page)

<button onClick={() => carouselRef?.current?.goTo(0)}>prev</button>

Reference https://www.npmjs.com/package/react-owl-carousel2

Hi there, I'm Anmol 👋

CodeSandbox    Discord    Linkedin    facebook    twitter    Instagram    slack    stackoverflow

Keywords

react

FAQs

Package last updated on 04 Apr 2025

Did you know?

Socket

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.

Install

Related posts