npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gridder-js

v0.7.0

Published

A JS plugin that displays a thumbnail grid expanding preview similar to the effect seen on Google Images.

Downloads

340

Readme

GridderJS

A JS plugin that displays a thumbnail grid expanding preview similar to the effect seen on Google Images.

We have all searched images on Google, so you probably noticed the interesting expanding preview when you click on a thumbnail. It’s a very nice effect and practical, allowing you quickly see more details without having to reload a new page. This plugin allows you to recreate a similar effect on a thumbnail grid. The idea is to open a preview when clicking on a thumbnail and to show a larger image and some other content like a title, a description and a link


Features

  • Multiple instances
  • Really easy to use and customize with CSS & HTML
  • Expanding preview with static content or dynamic (fetch) content
  • Responsive
  • Smooth Scrolling
  • Old / New Google Images display (expander underneath grid or as a sidebard on the right hand side)
  • Lightweight (2.6 kB gzipped)

Options


Quickstart

Install:

$ npm install --save gridder-js
# or with yarn:
$ yarn add gridder-js

Use as ES6 module (recommended):

import { GridderJS } from "gridder-js";
const gridder = new GridderJS("div#myId", {
    columns: 4,
    gap: 15
  });

or use as CommonJS module:

const { GridderJS } = require("gridder-js");
const gridder = new GridderJS("div#myId", {
    columns: 4,
    gap: 15
  });

Not using a package manager or bundler?:

<script src="https://unpkg.com/gridder-js@latest/dist/gridder-js-min.js"></script>
  1. HTML

       
    <!-- Gridder navigation -->
    <div class="gridder" id="myId">
      <div class="gridder-list">
       <!-- You can load specify which content is loaded by specifying the #ID of the div where the content is  -->
       <div data-target="content1"></div>
       <div data-target="content2"></div>
       <div data-target="content3"></div>
       <div data-target="content4"></div>
       <div data-target="content5"></div>
       <div data-target="content6"></div>
    
       <!-- You can specify data-url to load ajax content using fetch -->
       <div :data-url="'content.html'"></div>
      </div>
    </div>
    
    <!-- Gridder content -->
    <div id="content1" style="display:none"> Content 1 goes here... </div>
    <div id="content2" style="display:none"> Content 2 goes here... </div>
    <div id="content3" style="display:none"> Content 3 goes here... </div>
    <div id="content4" style="display:none"> Content 4 goes here... </div>
    <div id="content5" style="display:none"> Content 5 goes here... </div>
    <div id="content6" style="display:none"> Content 6 goes here... </div>
    
  2. Call the plugin:

    <script>
    	// Instantiate the plugin
      new GridderJS('.gridder', {
        columns: 4,
        gap: 15
      });
    </script>

This work is licensed under a Creative Commons Attribution 3.0 Unported License.