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

@libregrid/notes

v1.3.5

Published

Cell and full-width-row notes for AG Grid Community — part of LibreGrid

Readme

@libregrid/notes

Attach notes to cells or full-width rows. Users can open the note editor from the context menu or with Shift+F2, and noted cells show a marker. Your data source controls storage, metadata, and whether a note is editable.

Documentation and examples

Install

npm install "ag-grid-community@^36.2.0" @libregrid/notes

Requires ag-grid-community >=36.1.0 <37 as a peer dependency.

Usage

In a browser TypeScript project, add a grid container before running the code:

<div id="grid" style="height: 400px"></div>

Provide a notesDataSource that stores notes, and register the module:

import {
  ModuleRegistry,
  AllCommunityModule,
  createGrid,
  type Note,
  type NotesDataSource,
} from 'ag-grid-community';
import { NotesModule } from '@libregrid/notes';
import { ContextMenuModule } from '@libregrid/menu';

ModuleRegistry.registerModules([AllCommunityModule, NotesModule, ContextMenuModule]);

// A minimal in-memory data source (cell notes only).
const store = new Map<string, Note>();
const cellKey = (params: {
  rowNode: { id: string | undefined };
  column: { getColId(): string };
}): string => `${params.rowNode.id}::${params.column.getColId()}`;

const notesDataSource: NotesDataSource = {
  init: () => {},
  destroy: () => store.clear(),
  getNote: (params) => store.get(cellKey(params)),
  setNote: (params) => {
    if (params.note) {
      store.set(cellKey(params), params.note);
    } else {
      store.delete(cellKey(params));
    }
  },
};

const api = createGrid(document.querySelector<HTMLElement>('#grid')!, {
  columnDefs: [{ field: 'country' }, { field: 'sales' }],
  rowData: [
    { country: 'Japan', sales: 120 },
    { country: 'Canada', sales: 240 },
  ],
  getRowId: (params) => String(params.data.country), // stable ids are required
  notesDataSource,
});

Options

| Option | Default | Purpose | | ------------------------------------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------- | | notesDataSource | undefined | The NotesDataSource that stores notes. Set or clear it at any time with setGridOption; the grid reacts without a redraw. | | noteTrigger | 'hover' | 'hover' opens the popup after noteShowDelay; 'click' opens it on left mousedown. | | noteShowDelay | 180 | Milliseconds the pointer must rest on a noted cell before the popup opens (hover trigger). | | noteHideDelay | 220 | Milliseconds the pointer may stay off the popup before it closes again. | | isFullWidthRow + fullWidthCellRenderer | — | The standard full-width row options; full-width rows support notes when the data source sets supportsFullWidthRows: true. |

Per column, suppressNoteActions (boolean or (params: { node, column, data, colDef, api, context }) => boolean) hides all note interactions for that column. Suppressed cells with an existing note only offer View Note; without a note they offer nothing.

Behaviour

  • Opening: hover (default) or click, per noteTrigger. Shift+F2 on a rendered cell (or full-width row) also opens the editor, creating the note when there is none.
  • Editor: a resizable popup with the note text (a textarea when editable, a read-only div otherwise), the author, and Created / Updated lines rendered exactly as provided by your data source. Closing commits only when the text actually changed; a brand-new note is committed only if it has non-empty text. Metadata is never edited by the popup.
  • Markers: rendered cells and full-width rows carrying a note get the lgr-cell-has-note class (a small dot, styled by the module CSS).
  • Context menu: with @libregrid/menu registered, cells gain note items — Add Note (no note), Edit Note / Remove Note (editable), View Note with a disabled Remove Note (read-only).
  • Read-only: note.readOnly notes can be viewed but not edited or removed.
  • Change handling: the data source receives each setNote call. Use that callback to save changes; there is no noteChanged event.

For full-width notes, implement FullWidthNotesDataSource from ag-grid-community, set supportsFullWidthRows: true, and handle both cell and full-width-row locations in its callbacks.

The example stores notes in memory and loses them on grid destruction or page reload. Implement durable storage and access checks in your application’s data source. Read-only UI flags are not a substitute for server-side authorization.

API

| Export | Purpose | | --------------------------- | ------------------------------------------------------------------------------- | | NotesModule | Registers the feature (moduleName: 'Notes'). | | NotesService | Bean (notesSvc) — note access, popups, markers, the note context-menu item. | | NotesDataService | Bean (notesDataSvc) — validates and drives the notesDataSource lifecycle. | | api.getNote(params) | Read the note for a cell or full-width row. | | api.setNote(params) | Create, update or remove a note (pass note: undefined to remove). | | api.refreshNotes(params?) | Re-evaluate markers/popups, optionally scoped by rowNodes / columns. | | keyForParams(params) | Stable rowId::colId (or rowId::__fullWidth__) key used by the feature map. | | NOTE_MARKER_CLASS | The lgr-cell-has-note CSS class. |

Learn more

Angular

Use the same column definitions and grid options with ag-grid-angular. Register the modules shown above through provideLibreGrid from @libregrid/angular. See the Angular setup for a complete component and bootstrap example.

License

MIT — see LICENSE and NOTICE. LibreGrid is an independent project and is not affiliated with, endorsed by, or sponsored by AG Grid Ltd.