🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

trowl

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trowl

An ultra-lightweight, standalone, masonry-style grid library

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

Trowl

Masonry-style grid library.

  • Ultra-lightweight (1kb uglified and gzipped)
  • Uses CSS Grid
  • Zero dependencies

Installation

npm install trowl

Usage

Import it: import trowl from 'trowl';

Prepare your HTML

<div id="grid">
    <div class="box"></div>
    <div class="box"></div>
    <div class="box"></div>
    <div class="box"></div>
    ...
</div>

Use it:

const numberOfColumns = 5; // The number of columns in the grid
const gapSize = 10; // The size of the gap between items in pixels
const callback = () => alert('yay!'); // A callback after the grid has finished sorting items
trowl(document.getElementById('grid'), numberOfColumns, gapSize, callback);

Tip

I would make the grid opacity: 0 and use the callback to make it 1 with a low transition time (0.2s). There is a small chance that for a few microseconds, the interface shuffles about as it adjusts items.

Keywords

css

FAQs

Package last updated on 15 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts