NPM Star
Collections
  1. Home
  2. Compare
  3. owl.carousel vs slick-carousel
NPM Compare

Compare NPM packages statistics, trends, and features

CollectionsVS Code extensionChrome extensionTermsPrivacyLinkTreeIndiehackersBig Frontendqiuyumi

Unable to load comparison data. Please try again later.

Owl Carousel 2

Touch enabled jQuery plugin that lets you create a beautiful, responsive carousel slider. To get started, check out https://owlcarousel2.github.io/OwlCarousel2/.

Notice: The old Owl Carousel site (owlgraphic [dot] com) is no longer in use. Please delete all references to this in bookmarks and your own products' documentation as it's being used for malicious purposes.

Quick start

Install

This package can be installed with:

  • npm: npm install --save owl.carousel or yarn add owl.carousel jquery
  • bower: bower install --save owl.carousel

Or download the latest release.

Load

Webpack

Add jQuery via the "webpack.ProvidePlugin" to your webpack configuration:

const webpack = require('webpack');

//...
plugins: [
    new webpack.ProvidePlugin({
      $: 'jquery',
      jQuery: 'jquery',
      'window.jQuery': 'jquery'
    }),
],
//...

Load the required stylesheet and JS:

import 'owl.carousel/dist/assets/owl.carousel.css'; import 'owl.carousel';

Static HTML

Put the required stylesheet at the top of your markup:

<link rel="stylesheet" href="/node_modules/owl.carousel/dist/assets/owl.carousel.min.css" />
<link rel="stylesheet" href="/bower_components/owl.carousel/dist/assets/owl.carousel.min.css" />

NOTE: If you want to use the default navigation styles, you will also need to include owl.theme.default.css.

Put the script at the bottom of your markup right after jQuery:

<script src="/node_modules/jquery/dist/jquery.js"></script> <script src="/node_modules/owl.carousel/dist/owl.carousel.min.js"></script>
<script src="/bower_components/jquery/dist/jquery.js"></script> <script src="/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>

Usage

Wrap your items (div, a, img, span, li etc.) with a container element (div, ul etc.). Only the class owl-carousel is mandatory to apply proper styles:

<div class="owl-carousel owl-theme"> <div> Your Content </div> <div> Your Content </div> <div> Your Content </div> <div> Your Content </div> <div> Your Content </div> <div> Your Content </div> <div> Your Content </div> </div>

NOTE: The owl-theme class is optional, but without it, you will need to style navigation features on your own.

Call the plugin function and your carousel is ready.

$(document).ready(function(){ $('.owl-carousel').owlCarousel(); });

Documentation

The documentation, included in this repo in the root directory, is built with Assemble and publicly available at https://owlcarousel2.github.io/OwlCarousel2/. The documentation may also be run locally.

Building

This package comes with Grunt and Bower. The following tasks are available:

  • default compiles the CSS and JS into /dist and builds the doc.
  • dist compiles the CSS and JS into /dist only.
  • watch watches source files and builds them automatically whenever you save.
  • test runs JSHint and QUnit tests headlessly in PhantomJS.

To define which plugins are build into the distribution just edit /_config.json to fit your needs.

Contributing

Please read CONTRIBUTING.md.

Roadmap

Please make sure to check out our Roadmap Discussion.

License

The code and the documentation are released under the MIT License.

slick

the last carousel you'll ever need

Version 2.0

Version 2.0 is compatible with jQuery 4.

Demo

http://kenwheeler.github.io/slick

CDN

To start working with Slick right away, there's a couple of CDN choices available to serve the files as close, and fast as possible to your users:

  • https://cdnjs.com/libraries/slick-carousel
  • https://cdn.jsdelivr.net/gh/kenwheeler/slick/
Example using from jsDelivr

Just add a link to the css file in your <head>. If you are using jQuery 4.0 or higher, use the following:

<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/kenwheeler/slick@master/slick/slick.css"/> <!-- Add the slick-theme.css if you want default styling --> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/kenwheeler/slick@master/slick/slick-theme.css"/>

Then, before your closing <body> tag add:

<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/kenwheeler/slick@master/slick/slick.min.js"></script>

If you are using jQuery 3.0 or lower, use the following:

<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/kenwheeler/slick@1.8.1/slick/slick.css"/> <!-- Add the slick-theme.css if you want default styling --> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/kenwheeler/slick@1.8.1/slick/slick-theme.css"/>

Then, before your closing <body> tag add:

<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/kenwheeler/slick@1.8.1/slick/slick.min.js"></script>

Package Managers

# Bower bower install --save slick-carousel # NPM npm install slick-carousel

[!NOTE] Version 2.0.0 of Slick is currently not available via Bower or NPM. Please use the CDN links above to get the latest version.

Contributing

PLEASE review CONTRIBUTING.markdown prior to requesting a feature, filing a pull request or filing an issue.

Data Attribute Settings

In slick 1.5 you can now add settings using the data-slick attribute. You still need to call $(element).slick() to initialize slick on the element.

Example:

<div data-slick='{"slidesToShow": 4, "slidesToScroll": 4}'> <div><h3>1</h3></div> <div><h3>2</h3></div> <div><h3>3</h3></div> <div><h3>4</h3></div> <div><h3>5</h3></div> <div><h3>6</h3></div> </div>

Settings

Option | Type | Default | Description ------ | ---- | ------- | ----------- accessibility | boolean | true | Enables tabbing and arrow key navigation. Unless autoplay: true, sets browser focus to current slide (or first of current slide set, if multiple slidesToShow) after slide change. For full a11y compliance enable focusOnChange in addition to this. adaptiveHeight | boolean | false | Adapts slider height to the current slide appendArrows | string | $(element) | Change where the navigation arrows are attached (Selector, htmlString, Array, Element, jQuery object) appendDots | string | $(element) | Change where the navigation dots are attached (Selector, htmlString, Array, Element, jQuery object) arrows | boolean | true | Enable Next/Prev arrows asNavFor | string | $(element) | Enables syncing of multiple sliders autoplay | boolean | false | Enables auto play of slides autoplaySpeed | int | 3000 | Auto play change interval centerMode | boolean | false | Enables centered view with partial prev/next slides. Use with odd numbered slidesToShow counts. centerPadding | string | '50px' | Side padding when in center mode. (px or %) cssEase | string | 'ease' | CSS3 easing customPaging | function | n/a | Custom paging templates. See source for use example. dots | boolean | false | Current slide indicator dots dotsClass | string | 'slick-dots' | Class for slide indicator dots container draggable | boolean | true | Enables desktop dragging easing | string | 'linear' | animate() fallback easing edgeFriction | integer | 0.15 | Resistance when swiping edges of non-infinite carousels fade | boolean | false | Enables fade focusOnSelect | boolean | false | Enable focus on selected element (click) focusOnChange | boolean | false | Puts focus on slide after change infinite | boolean | true | Infinite looping initialSlide | integer | 0 | Slide to start on lazyLoad | string | 'ondemand' | Accepts 'ondemand' or 'progressive' for lazy load technique. 'ondemand' will load the image as soon as you slide to it, 'progressive' loads one image after the other when the page loads. mobileFirst | boolean | false | Responsive settings use mobile first calculation nextArrow | string (html | jQuery selector) | object (DOM node | jQuery object) | <button type="button" class="slick-next">Next</button> | Allows you to select a node or customize the HTML for the "Next" arrow. pauseOnDotsHover | boolean | false | Pauses autoplay when a dot is hovered pauseOnFocus | boolean | true | Pauses autoplay when slider is focussed pauseOnHover | boolean | true | Pauses autoplay on hover prevArrow | string (html | jQuery selector) | object (DOM node | jQuery object) | <button type="button" class="slick-prev">Previous</button> | Allows you to select a node or customize the HTML for the "Previous" arrow. respondTo | string | 'window' | Width that responsive object responds to. Can be 'window', 'slider' or 'min' (the smaller of the two). responsive | array | null | Array of objects containing breakpoints and settings objects (see example). Enables settings at given breakpoint. Set settings to "unslick" instead of an object to disable slick at a given breakpoint. rows | int | 1 | Setting this to more than 1 initializes grid mode. Use slidesPerRow to set how many slides should be in each row. rtl | boolean | false | Change the slider's direction to become right-to-left slide | string | '' | Slide element query slidesPerRow | int | 1 | With grid mode initialized via the rows option, this sets how many slides are in each grid row. slidesToScroll | int | 1 | # of slides to scroll at a time slidesToShow | int | 1 | # of slides to show at a time speed | int | 300 | Transition speed swipe | boolean | true | Enables touch swipe swipeToSlide | boolean | false | Swipe to slide irrespective of slidesToScroll touchMove | boolean | true | Enables slide moving with touch touchThreshold | int | 5 | To advance slides, the user must swipe a length of (1/touchThreshold) * the width of the slider. useCSS | boolean | true | Enable/Disable CSS Transitions useTransform | boolean | true | Enable/Disable CSS Transforms variableWidth | boolean | false | Disables automatic slide width calculation vertical | boolean | false | Vertical slide direction verticalSwiping | boolean | false | Changes swipe direction to vertical waitForAnimate | boolean | true | Ignores requests to advance the slide while animating zIndex | number | 1000 | Set the zIndex values for slides, useful for IE9 and lower

Responsive Option Example

The responsive option, and value, is quite unique and powerful. You can use it like so:

$(".slider").slick({ // normal options... infinite: false, // the magic responsive: [{ breakpoint: 1024, settings: { slidesToShow: 3, infinite: true } }, { breakpoint: 600, settings: { slidesToShow: 2, dots: true } }, { breakpoint: 300, settings: "unslick" // destroys slick }] });

Events

In slick 1.4, callback methods were deprecated and replaced with events. Use them before the initialization of slick as shown below:

// On swipe event $('.your-element').on('swipe', function(event, slick, direction){ console.log(direction); // left }); // On edge hit $('.your-element').on('edge', function(event, slick, direction){ console.log('edge was hit') }); // On before slide change $('.your-element').on('beforeChange', function(event, slick, currentSlide, nextSlide){ console.log(nextSlide); });

Event | Params | Description ------ | -------- | ----------- afterChange | event, slick, currentSlide | After slide change callback beforeChange | event, slick, currentSlide, nextSlide | Before slide change callback breakpoint | event, slick, breakpoint | Fires after a breakpoint is hit destroy | event, slick | When slider is destroyed, or unslicked. edge | event, slick, direction | Fires when an edge is overscrolled in non-infinite mode. init | event, slick | When Slick initializes for the first time callback. Note that this event should be defined before initializing the slider. reInit | event, slick | Every time Slick (re-)initializes callback setPosition | event, slick | Every time Slick recalculates position swipe | event, slick, direction | Fires after swipe/drag lazyLoaded | event, slick, image, imageSource | Fires after image loads lazily lazyLoadError | event, slick, image, imageSource | Fires after image fails to load

Methods

Methods are called on slick instances through the slick method itself in version 1.4, see below:

// Add a slide $('.your-element').slick('slickAdd',"<div></div>"); // Get the current slide var currentSlide = $('.your-element').slick('slickCurrentSlide');

This new syntax allows you to call any internal slick method as well:

// Manually refresh positioning of slick $('.your-element').slick('setPosition');

Method | Argument | Description ------ | -------- | ----------- slick | options : object | Initializes Slick unslick | | Destroys Slick slickNext | | Triggers next slide slickPrev | | Triggers previous slide slickPause | | Pause Autoplay slickPlay | | Start Autoplay (will also set autoplay option to true) slickGoTo | index : int, dontAnimate : bool | Goes to slide by index, skipping animation if second parameter is set to true slickCurrentSlide | | Returns the current slide index slickAdd | element : html or DOM object, index: int, addBefore: bool | Add a slide. If an index is provided, will add at that index, or before if addBefore is set. If no index is provided, add to the end or to the beginning if addBefore is set. Accepts HTML String || Object slickRemove | index: int, removeBefore: bool | Remove slide by index. If removeBefore is set true, remove slide preceding index, or the first slide if no index is specified. If removeBefore is set to false, remove the slide following index, or the last slide if no index is set. slickFilter | filter : selector or function | Filters slides using jQuery .filter syntax slickUnfilter | | Removes applied filter slickGetOption | option : string(option name) | Gets an option value. slickSetOption | change an option, refresh is always boolean and will update UI changes... | option, value, refresh | change a single option to given value; refresh is optional. | "responsive", [{ breakpoint: n, settings: {} }, ... ], refresh | change or add whole sets of responsive options | { option: value, option: value, ... }, refresh | change multiple options to corresponding values.

Example

Initialize with:

$(element).slick({ dots: true, speed: 500 });

Change the speed with:

$(element).slick('slickSetOption', 'speed', 5000, true);

Destroy with:

$(element).slick('unslick');

Sass Variables

Variable | Type | Default | Description ------ | ---- | ------- | ----------- $slick-font-path | string | "./fonts/" | Directory path for the slick icon font $slick-font-family | string | "slick" | Font-family for slick icon font $slick-loader-path | string | "./" | Directory path for the loader image $slick-arrow-color | color | white | Color of the left/right arrow icons $slick-dot-color | color | black | Color of the navigation dots $slick-dot-color-active | color | $slick-dot-color | Color of the active navigation dot $slick-prev-character | string | '\2190' | Unicode character code for the previous arrow icon $slick-next-character | string | '\2192' | Unicode character code for the next arrow icon $slick-dot-character | string | '\2022' | Unicode character code for the navigation dot icon $slick-dot-size | pixels | 6px | Size of the navigation dots

Browser support

Slick works on IE8+ in addition to other modern browsers such as Chrome, Firefox, and Safari.

Dependencies

jQuery 1.7

License

Copyright (c) 2017 Ken Wheeler

Licensed under the MIT license.

Free as in Bacon.

Dependencies Comparison

owl.carousel

Dependencies

jquery>=1.8.3

Dev Dependencies

grunt^0.4.5
pretty^1.0.0
blanket^1.1.7
qunitjs^1.18.0
assemble~0.4.37
grunt-jscs~1.8.0
grunt-sass^1.0.0
grunt-banner^0.4.0
grunt-gh-pages^0.10.0
foundation-sites~5.5.2
load-grunt-tasks^3.2.0
grunt-autoprefixer^3.0.3
grunt-contrib-copy~0.8.0
grunt-blanket-qunit^0.2.0
grunt-contrib-clean~0.6.0
grunt-contrib-qunit>=0.2.1
grunt-contrib-watch^0.6.1
grunt-contrib-concat~0.5.1
grunt-contrib-cssmin^0.12.3
grunt-contrib-jshint^0.11.2
grunt-contrib-uglify^0.9.1
grunt-contrib-connect~0.10.1
grunt-contrib-compress~0.13.0

Peer Dependencies

slick-carousel

Dependencies

Dev Dependencies

Peer Dependencies

jquery>=1.8.0
StarsIssuesVersionUpdatedⓘLast publish dateCreatedⓘPackage creation dateSizeⓘMinified + Gzipped size
O
owl.carousel
7,8801,1922.3.44 years ago10 years agoinstall size 11.2 KB
S
slick-carousel
28,5221,2662.0.02 months ago12 years agoinstall size 10.3 KB

Who's Using These Packages

owl.carousel

dtube
dtube

:tv: d.tube app. A full-featured video sharing website, decentralized.

Angular-ShoppingCart
Angular-ShoppingCart

ShoppingCart (Ecommerce) 🛒 Application using Angular10, Firebase, PWA, Drag&Drop, Materialized Bootstrap and i18n 🚀🔥👨‍💻

Webiny
Webiny

[NOT MAINTAINED] Main Webiny app responsible for parsing requests and bootstrapping other apps. Includes all the core ReactJs components.

plugin-ceres
plugin-ceres

This is the official Ceres plugin developed by plentymarkets. Ceres is the default template plugin for plentymarkets 7 online stores.

Cybros-Web-Application
Cybros-Web-Application

Cybros Web Application Development

slick-carousel

bellshade-website-v1
bellshade-website-v1

Repositori untuk web organisasi bellshade (Versi lama)

youtubeportfolio
youtubeportfolio
pola-web
pola-web

Pola pomoże Ci odnaleźć polskie wyroby. Zabierając Polę na zakupy odnajdujesz produkty “z duszą” i wspierasz polską gospodarkę.

chillAjar
chillAjar

Peer to Peer Tutoring Platform "ChillAjar" | Frontend

litterpic_org
litterpic_org

LitterPic.org Next.JS site