Skip to content
EinLinuusPublic

About

A simple and lightweight library to filter and sort elements, and it's even animated!

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

GridWave logo

Lightweight, animated JavaScript grids

GridWave is a small, dependency-free library for responsive DOM layouts with filtering, sorting, animation, equal-height rows, and experimental masonry.

GridWave is in early development and might not be suitable for production use. Please open an issue if you encounter a problem.

See the complete documentation or try the CodePen demo.

Installation

npm install gridwave
import GridWave from "gridwave";

You can also load GridWave from a CDN:

<script src="https://unpkg.com/[email protected]"></script>

Quick start

<button type="button" data-filter="">All</button>
<button type="button" data-filter=".featured">Featured</button>

<div id="grid">
  <article class="card featured">First item</article>
  <article class="card">Second item</article>
  <article class="card featured">Third item</article>
</div>

<script>
  const grid = new GridWave("#grid", {
    columns: 3,
    gap: 16,
    breakpoints: {
      768: {
        columns: 2,
        gap: 12,
      },
      480: {
        columns: 1,
        gap: 8,
      },
    },
  });

  document.querySelectorAll("[data-filter]").forEach((button) => {
    button.addEventListener("click", () => {
      grid.filter(button.dataset.filter);
    });
  });
</script>

Documentation

Examples

Clone the repository and run:

php -S localhost:8000

Then open http://localhost:8000/examples/.

License

GridWave is available under the MIT License.

Contact

Reach Linus Benkner on X at @linusbenkner or by email at [email protected].

About

A simple and lightweight library to filter and sort elements, and it's even animated!

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages