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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ng2-gridstack

v1.0.0

Published

A gridstack component for Angular2+

Downloads

93

Readme

ng2-gridstack

A gridstack component for Angular2+. Based on gridstack.js 0.3.0.

Usage

Requirements

Install

NPM version

$ npm install ng2-gridstack --save

Basic Usage

Import the module...

import { GridStackModule } from 'ng2-gridstack'
(...)

@NgModule({
    imports: [
        (...)
        GridStackModule,
    ],
    declarations: [
        GridStackComponent,
        GridStackItemDirective,
		(...)
    ],
    providers: [
		(...)
    ]
})
export class YourModule { }

and load gridstack's css. Example using the global css file from AngularCLI

/* You can add global styles to this file, and also import other style files */
@import "~gridstack/dist/gridstack.min.css";

ng2-gridstack can be used in two ways, either by letting the component add the items for you, or by building your own items.

First mode

<gridStack w="12" animate="true" 
	buttonClass="btn btn-default" 
	allowEditing="true" 
	[options]="gridstackOptions"
	[items]="panel.Cards" 
	(addFunction)="addCard()" 
	(saveFunction)="save($event)" 
	(deleteFunction)="deletePanel()" 
	(deleteCardFunc)="deleteCard($event)"
	[addButtonText]="'Add card'"
	[saveButtonText]="'Save panel'"
	[deleteButtonText]="'Delete panel'"
	[deleteCardButtonText]="'Delete card'">
</gridStack>

Second mode

<gridStack w="12" animate="true">
	<div gridStackItem
		[x]="0" [y]="0" [h]="3" [w]="3" [customid]="10">
		<h1>Hello</h1>
	</div>
</gridStack>

Inputs/Outputs

  • w : number of items that can fit in a row.

  • animate : grid animation on/off.

  • options (optional) : an associative array of gridstack options.

  • allowEditing : allow the edition of items on double click (false by default).

  • items (optional) : an array of objects that have the following properties.

    • x
    • y
    • width
    • height
    • customid
    • content (optional)
  • addButtonText (optional) : If present, will display a button that triggers addFunction.

  • saveButtonText (optional) : If present, will display a button that triggers saveFunction.

  • deleteButtonText (optional) : If present, will display a button that triggers deleteFunction.

  • deleteCardButtonText (optional) : If present, will display a button that triggers deleteCardFunc.

  • addFunction (optional) : this function should add a new item to the array passed in the items parameter.

  • saveFunction (optional) : calls the specified function with the updated array of items as parameter, so that you can save it.

  • deleteFunction (optional) : function to call when deleting the whole panel.

  • deleteCardFunc (optional) : function to call when a card is deleted (its customid is passed as a parameter).