2017 © Pedro Peláez
 

library mixitup

image

patrickkunka/mixitup

  • Tuesday, March 6, 2018
  • by c33s
  • Repository
  • 183 Watchers
  • 4108 Stars
  • 3,124 Installations
  • JavaScript
  • 3 Dependents
  • 0 Suggesters
  • 684 Forks
  • 11 Open issues
  • 28 Versions
  • 7 % Grown

The README.md

📣 November 2024 Update 📣

Changes to License Model

As MixItUp turns 10 years old (and having remained unchanged since ~2018) it will be moving to a fully open source and publicly available model. This means that from 1st November 2024, you no longer need to purchase a license for commercial use., (*1)

Additionally, the MixItUp project and its extensions will become fully archived meaning that no future changes will be made. MixItUp has been stable for many years and remains in use across tens of thousands of web sites and applications worldwide. If you wish to use it on a brand-new project and it meets your needs, then you should feel confident in doing so provided you do not require support., (*2)

Pagination and MultiFilter Extensions

The Pagination and MultiFilter extensions, which were previously closed source and only available via purchase, have also been been made publicly available on GitHub, and may now be used without purchase or a commercial license., (*3)

Documentation Website

The documentation website has been retired in favor of GitHub. All documentation and tutorials are available via this GitHub repository, or the repository of the relevant extension (see above)., (*4)

Demos

Hosted interactive demos may be found at patrickkunka.github.io/mixitup/demos. The documented source code of each demo can be found in the /demos directory if this repository., (*5)

Demos for the Pagination and MultiFilter extensions can be found linked to in their respective repositories., (*6)


MixItUp 3

Latest Release jsDelivr Hits, (*7)

MixItUp is a high-performance, dependency-free library for animated DOM manipulation, giving you the power to filter, sort, add and remove DOM elements with beautiful animations., (*8)

MixItUp plays nice with your existing HTML and CSS, making it a great choice for responsive layouts and compatible with inline-flow, percentages, media queries, flexbox and more., (*9)

Migrating from MixItUp 2? Check out the MixItUp 3 Migration Guide., (*10)

Licensing

MixItUp is open source and free to use for all use cases, under the Apache 2.0 license., (*11)

Documentation

Tutorials

Integrating MixItUp into Your Project

MixItUp can be used with static sites, CMSs, web apps and more. This tutorial will help you choose the right integration for your project., (*12)

Filtering with MixItUp

A summary of the various filtering techniques available in MixItUp – filter/toggle controls, multidimensional filtering, and the filter API., (*13)

Sorting with MixItUp

A summary of the various sorting techniques available in MixItUp – default sort, attribute sort, multi-attribute sort, and the sort API., (*14)

MixItUp Grid Layouts

A summary of the three most common approaches to responsive grids – inline-block, flex-box, and floats – in the context of MixItUp., (*15)

Marking Up MixItUp Containers

This tutorial explores various container markup structures, and explains what is and isn't possible with MixItUp., (*16)

Filtering and Sorting on Load

A look at how we can use the configuration object to load MixItUp in a state other than its default filtering and sorting behavior., (*17)

Using the Dataset API

New to MixItUp 3, the Dataset API allows interaction with MixItUp purely via changes to a data model, avoiding the use of DOM selectors., (*18)

Browser Support

MixItUp 3 has been tested for compatibility with the following browsers., (*19)

  • Chrome 16+
  • Firefox 16+
  • Safari 6.2+
  • Yandex 14+
  • Edge 13+
  • IE 10+ (with animations), IE 8-9 (no animations)

Getting Started

Contents

Most commonly, MixItUp is applied to a "container" of "target" elements, which could be a portfolio of projects, a list of blog posts, a selection of products, or any kind of UI where filtering and/or sorting would be advantageous., (*20)

To get started, follow these simple steps:, (*21)

Building the Container

By default, MixItUp will query the container for targets matching the selector '.mix'., (*22)

<div class="container">
    <div class="mix category-a" data-order="1"></div>
    <div class="mix category-b" data-order="2"></div>
    <div class="mix category-b category-c" data-order="3"></div>
    <div class="mix category-a category-d" data-order="4"></div>
</div>

Targets can be filtered using any valid selector e.g. '.category-a', and are sorted via optional custom data attributes e.g. 'data-order'., (*23)

Further reading: Marking-up MixItUp Containers, (*24)

Building Controls

One way that filtering and sorting happens is when controls are clicked. You may use any clickable element as a control, but <button type="button"> is recommended for accessibility., (*25)

Filter Controls

Filter controls are queried based on the presence of a data-filter attribute, whose value must be 'all', 'none', or a valid selector string e.g. '.category-a'., (*26)

<button type="button" data-filter="all">All</button>
<button type="button" data-filter=".category-a">Category A</button>
<button type="button" data-filter=".category-b">Category B</button>
<button type="button" data-filter=".category-c">Category C</button>

Further reading: Filtering with MixItUp, (*27)

Sort Controls

Sort controls are queried based on the presence of a data-sort attribute, whose value takes the form of a "sort string" made up of the name of the attribute to sort by, followed by an optional colon-separated sorting order e.g. 'order', 'order:asc', 'order:desc'., (*28)

<button type="button" data-sort="order:asc">Ascending</button>
<button type="button" data-sort="order:descending">Descending</button>
<button type="button" data-sort="random">Random</button>

The values 'default' and 'random' are also valid, with 'default' referring to the original order of target elements in the DOM at the time of mixer instantiation., (*29)

Further reading: Sorting with MixItUp, (*30)

Styling the Container

While MixItUp can be added on top of any existing CSS layout, we strongly recommend inline-block or flexbox-based styling over floats and legacy grid frameworks when dealing with grid-based designs for a number of reasons., (*31)

Further reading: MixItUp Grid Layouts, (*32)

Loading MixItUp

Firstly, load the MixItUp JavaScript library using the preferred method for your project., (*33)

Script Tag

The most simple way to load MixItUp in your project is to include it via a <script> tag before the closing </body> tag on your page., (*34)

        ...

        <script src="/path/to/mixitup.min.js"></script>
    </body>
</html>

With this technique, the MixItUp factory function will be made available via the global variable mixitup., (*35)

Module Import

If you are building a modular JavaScript project with Webpack, Browserify, or RequireJS, MixItUp can be installed using your package manager of choice (e.g. npm, jspm, yarn) and then imported into any of your project's modules., (*36)

npm install mixitup --save, (*37)

// ES2015

import mixitup from 'mixitup';
// CommonJS

var mixitup = require('mixitup');
// AMD

require(['mixitup'], function(mixitup) {

});

Creating a Mixer

With the mixitup() factory function available, you may now instantiate a "mixer" on your container to enable MixItUp functionality., (*38)

Call the factory function passing a selector string or a reference to your container element as the first parameter, and a the newly instantiated mixer will be returned., (*39)

Example: Instantiating a mixer with a selector string
var mixer = mixitup('.container');
Example: Instantiating a mixer with an element reference
var mixer = mixitup(containerEl);

Your mixer is now ready for you to interact with, either via its controls (see above), or its API (see Mixer API Methods). Click a control or call an API method to check that everything is working correctly., (*40)

Configuration

If you wish to customize the functionality of your mixer, an optional "configuration object" can be passed as the second parameter to the mixitup function. If no configuration object is passed, the default settings will be used., (*41)

Further reading: Configuration Object, (*42)

Example: Passing a configuration object
var mixer = mixitup(containerEl, {
    selectors: {
        target: '.blog-item'
    },
    animation: {
        duration: 300
    }
});

Using the API

If you wish to interact with your mixer via its API, the mixer reference returned by the factory function can be used to call API methods., (*43)

Example: Calling an API method
var mixer = mixitup(containerEl);

mixer.filter('.category-a');

Further reading: Mixer API Methods, (*44)

Building a modern JavaScript application?

You may wish to use MixItUp 3's new "dataset" API. Dataset is designed for use in API-driven JavaScript applications, and can be used instead of DOM-based methods such as .filter(), .sort(), .insert(), etc. When used, insertion, removal, sorting and pagination can be achieved purely via changes to your data model, without the uglyness of having to interact with or query the DOM directly., (*45)

Further reading: Using the Dataset API, (*46)

The Versions

06/03 2018

v3.0.0

3.0.0.0

  Sources   Download

06/03 2018

v3.1.4

3.1.4.0

  Sources   Download

06/03 2018

v3.1.5

3.1.5.0

  Sources   Download

06/03 2018

v3.0.1

3.0.1.0

  Sources   Download

06/03 2018

v3.1.0

3.1.0.0

  Sources   Download

06/03 2018

v3.1.1

3.1.1.0

  Sources   Download

06/03 2018

v3.1.2

3.1.2.0

  Sources   Download

06/03 2018

v3.1.3

3.1.3.0

  Sources   Download

12/02 2018

v3.x-dev

3.9999999.9999999.9999999-dev https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

12/02 2018

v3.3.0

3.3.0.0 https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

11/11 2017

v3.2.2

3.2.2.0 https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

27/06 2017

v3.2.1

3.2.1.0 https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

24/06 2017

v3.2.0

3.2.0.0 https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

06/06 2017

v3.1.12

3.1.12.0 https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

14/05 2017

v3.1.11

3.1.11.0 https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

21/04 2017

v3.1.10

3.1.10.0 https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

18/03 2017

v3.1.9

3.1.9.0 https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

04/03 2017

v3.1.8

3.1.8.0 https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

09/02 2017

v3.1.7

3.1.7.0 https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

29/01 2017

v3.1.6

3.1.6.0 https://www.kunkalabs.com/mixitup/

A high-performance, dependency-free library for animated filtering, sorting and more

  Sources   Download

proprietary

javascript filtering sorting animate

10/10 2016

v2.x-dev

2.9999999.9999999.9999999-dev https://mixitup.kunkalabs.com/

MixItUp is a jQuery plugin providing animated filtering and sorting.

  Sources   Download

proprietary CC-BY-NC-4.0

jquery javascript filtering grid sorting animate mix

28/09 2015

v2.1.11

2.1.11.0 https://mixitup.kunkalabs.com/

MixItUp is a jQuery plugin providing animated filtering and sorting.

  Sources   Download

proprietary CC-BY-NC-4.0

jquery javascript filtering grid sorting animate mix

26/08 2015

v2.1.10

2.1.10.0 https://mixitup.kunkalabs.com/

MixItUp is a jQuery plugin providing animated filtering and sorting.

  Sources   Download

proprietary CC-BY-NC-4.0

jquery javascript filtering grid sorting animate mix

11/07 2015

v2.1.9

2.1.9.0 https://mixitup.kunkalabs.com/

MixItUp is a jQuery plugin providing animated filtering and sorting.

  Sources   Download

proprietary CC-BY-NC-4.0

jquery javascript filtering grid sorting animate mix

14/05 2015

v2.1.8

2.1.8.0 https://mixitup.kunkalabs.com/

MixItUp is a jQuery plugin providing animated filtering and sorting.

  Sources   Download

proprietary CC-BY-NC-4.0

jquery javascript filtering grid sorting animate mix

11/09 2014

v2.1.7

2.1.7.0 https://mixitup.kunkalabs.com/

MixItUp is a jQuery plugin providing animated filtering and sorting.

  Sources   Download

proprietary CC-BY-NC-4.0

jquery javascript filtering grid sorting animate mix

11/08 2014

v2.1.6

2.1.6.0 https://mixitup.kunkalabs.com/

MixItUp is a jQuery plugin providing animated filtering and sorting.

  Sources   Download

proprietary CC-BY-NC-4.0

jquery javascript filtering grid sorting animate mix

25/05 2014

v2.1.5

2.1.5.0 https://mixitup.kunkalabs.com/

MixItUp is a jQuery plugin providing animated filtering and sorting.

  Sources   Download

proprietary CC-BY-NC-4.0

jquery javascript filtering grid sorting animate mix