grid-align

1.0.1 • Public • Published

Grid Align

**Grid Align** is a simple JavaScript library for aligning children of grid-like elements, so that there is no unused white space at the end of the rows.

NOTE: I know the algorithm is not perfect, but it is the fastest one I could come up with for working with a lot of items (100+)

Install:

npm i -S grid-align

Options

randomizeRows

Randomizes the order of the rows (excluding the last row). With this option disabled, the larger elements will all be at the top of the grid.

alignGrid(element, {
    randomizeRows: true
});

animation

Duration (in milliseconds) animation should last during alignment.

alignGrid(element, {
    animation: 1000
});

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i grid-align

    Weekly Downloads

    4

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    1.83 MB

    Total Files

    9

    Last publish

    Collaborators

    • owenm