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

eq-grid

v0.1.7

Published

Next generation grid made via custom element

Downloads

3

Readme

eq-grid

1KB (gzipped) next generation responsive grid made via custom element <eq-grid>.

It is made to to be used inside various modern JS frameworks; built around idea of element queries (responsiveness is based on container width, rather than window width). So you can use it inside components without a need to think, how wide is your comonent.

See its real usage in this React example app. (there are more howtos in layout section)

Grid resizing example

Install and usage

To install:

npm i eq-grid --save

To use in your project:

Import the initEqGrid from eq-grid and run it with optional parameters. You need to do it before you render anything;

import { initEqGrid } from 'eq-grid';
initEqGrid(10, 1, 'rem');

initEqGrid accepts 4 optional parameters:

  • 'column width' (default: 100)
  • 'gap width' (default: 16)
  • 'units' (default: 'px')
  • 'maxColspan' (default: 6) - if it is six, classes like .eq-col-N will be generated with N upto 'maxColspan'

Your project needs to be either transpiled to es6 (es2015) or newer, or use es5 and include <script src="https://unpkg.com/@webcomponents/[email protected]/custom-elements-es5-adapter.js"></script> in your <HTML><HEAD>

Usage

Grid container <eq-grid>

| | | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | <eq-grid> | Define element as grid container. | | .eq-grid-dense | Add grid-auto-flow: dense;. It tries to fill empty gaps in the grid with out of order elements. | | .eq-grid-N-collapse | (N: numbers from 2 to maxColspan) Tells when children of the container collapse to full width. eq-grid-n-collapse collapse when container is smaller than (n + 1) * columnWidth | | .eq-grid-gap-N | (N: 0, 0-5, 2) Set the gap between elements of column 0 => 0 0-5 => half of default gap 1 => default (this is default hence there is not class for it) 2 => double of the default gap |

Grid children

| | | | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------- | | .eq-col .eq-col-N | (N:number from 2 to maxColspan) Define how many columns the element will take. | | .eq-col-max | This element always has full (container's) width | | .eq-row-N | (N:number from 2 to 3) Define how many rows the element will take. | | .eq-col-N-M | (N, M: numbers from 2 to maxColspan) Define how many columns the element will take (N) at specific grid size (M) | | .eq-col-N-collapse | Tells at which container size it sould collapse to full width. |

Support

| Browser | Version | | ------------------ | ------- | | Edge | 79+ | | Firefox | 69+ | | Chrome | 64+ | | Safari | 13.1+ | | Opera | 52+ | | iOS Safari | 13.4+ | | Android Browser | yes | | Opera mini | No | | Chrome for Android | yes |

Examples

Eq-grid is a native component based and hence works in almost all FE frameworks, you can check test integrations with React, Angular, Vue and Svelte

(Note that some of the implementation don't use eq-grid npm package from github - but rather use local file, it is caused by limitation by codesandbox, which doesn't allow user to change some of default transpile settings for certain framework)