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

@nacmias/data-grid

v0.1.0

Published

A feature-rich data grid component with toolbar, filtering, sorting, grouping, and row expansion modal

Readme

@nacmias/data-grid

A feature-rich, Airtable-like data grid component for React applications. Built on top of react-data-grid.

Features

  • Search - Global search across all columns
  • Filter - Column-based filtering with multiple operators
  • Sort - Single and multi-column sorting
  • Group - Group rows by column values
  • Column Visibility - Show/hide columns
  • Row Selection - Single and multi-select with checkboxes
  • Row Expansion - Modal for viewing/editing full record
  • Action Buttons - Customizable actions (expand, webhook, etc.)
  • Custom Editors - Select dropdowns, date pickers
  • Virtualization - Efficient rendering of large datasets
  • TypeScript - Full type support

Installation

npm install @nacmias/data-grid
# or
yarn add @nacmias/data-grid

Quick Start

import { DataGrid, type ColumnDefinition } from '@nacmias/data-grid';
import '@nacmias/data-grid/styles.css';

interface Contact {
  id: string;
  name: string;
  email: string;
  type: 'person' | 'company';
  created_at: string;
}

const columns: ColumnDefinition<Contact>[] = [
  { key: 'name', name: 'Name', sortable: true, filterable: true },
  { 
    key: 'type', 
    name: 'Type',
    fieldType: 'select',
    selectOptions: [
      { value: 'person', label: 'Person' },
      { value: 'company', label: 'Company' },
    ],
    groupable: true,
  },
  { key: 'email', name: 'Email', fieldType: 'email' },
  { key: 'created_at', name: 'Created', fieldType: 'date' },
];

function App() {
  const [contacts, setContacts] = useState<Contact[]>([]);

  return (
    <div style={{ height: '600px' }}>
      <DataGrid
        data={contacts}
        columns={columns}
        rowKeyGetter={(row) => row.id}
        onRowChange={(row) => console.log('Row changed:', row)}
        onWebhook={(row) => console.log('Webhook:', row)}
      />
    </div>
  );
}

Props

DataGridProps

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | T[] | Required | Array of data rows | | columns | ColumnDefinition<T>[] | Required | Column definitions | | rowKeyGetter | (row: T) => string | Required | Function to get unique key for each row | | onRowChange | (row: T) => void | - | Called when a row is edited | | onRowsChange | (rows: T[]) => void | - | Called when rows are bulk changed | | onWebhook | (row: T) => void | - | Called when webhook button is clicked | | onRowExpand | (row: T) => void | - | Called when row is expanded | | onSelectionChange | (selectedRows: ReadonlySet<string>) => void | - | Called when selection changes | | enableSearch | boolean | true | Enable search functionality | | enableFilter | boolean | true | Enable filtering | | enableSort | boolean | true | Enable sorting | | enableGroup | boolean | true | Enable grouping | | enableColumnToggle | boolean | true | Enable column visibility toggle | | enableSelection | boolean | true | Enable row selection | | enableActions | boolean | true | Enable action buttons column | | enableRowExpand | boolean | true | Enable row expansion modal | | enableWebhook | boolean | true | Enable webhook button | | height | string \| number | '100%' | Grid height | | searchPlaceholder | string | 'Search...' | Search input placeholder | | toolbarColors | Partial<ToolbarColors> | - | Custom toolbar button colors | | modalTitle | (row: T) => string | - | Custom modal title | | modalFields | string[] | - | Fields to show in modal |

ColumnDefinition

| Prop | Type | Default | Description | |------|------|---------|-------------| | key | string | Required | Unique column key | | name | string | Required | Column header text | | width | number | - | Column width in pixels | | minWidth | number | - | Minimum column width | | maxWidth | number | - | Maximum column width | | frozen | boolean | false | Freeze column to left | | resizable | boolean | true | Allow column resize | | sortable | boolean | true | Allow sorting | | filterable | boolean | true | Allow filtering | | groupable | boolean | false | Allow grouping by this column | | editable | boolean | true | Allow editing in modal | | fieldType | FieldType | 'text' | Field type for modal editor | | selectOptions | SelectOption[] | - | Options for select field type | | getValue | (row: T) => unknown | - | Custom value getter | | setValue | (row: T, value: unknown) => T | - | Custom value setter | | renderCell | (props) => ReactNode | - | Custom cell renderer | | renderEditCell | (props) => ReactNode | - | Custom cell editor |

FieldType

  • 'text' - Text input
  • 'number' - Number input
  • 'email' - Email input
  • 'phone' - Phone input
  • 'select' - Dropdown select
  • 'date' - Date picker
  • 'datetime' - DateTime picker
  • 'readonly' - Read-only display

Toolbar Colors

Customize the Airtable-like color-coded toolbar buttons:

<DataGrid
  toolbarColors={{
    columns: { main: '#7c3aed', bg: '#f3e8ff' }, // Purple
    sort: { main: '#2563eb', bg: '#dbeafe' },    // Blue
    filter: { main: '#16a34a', bg: '#dcfce7' },  // Green
    group: { main: '#d97706', bg: '#fef3c7' },   // Amber
  }}
/>

Custom Cell Renderers

const columns: ColumnDefinition<Contact>[] = [
  {
    key: 'status',
    name: 'Status',
    renderCell: ({ row }) => (
      <span style={{
        padding: '2px 8px',
        borderRadius: '4px',
        background: row.status === 'active' ? '#dcfce7' : '#fee2e2',
        color: row.status === 'active' ? '#16a34a' : '#dc2626',
      }}>
        {row.status}
      </span>
    ),
  },
];

Nested Values

Handle nested object properties:

const columns: ColumnDefinition<Contact>[] = [
  {
    key: 'city',
    name: 'City',
    getValue: (row) => row.address?.city,
    setValue: (row, value) => ({
      ...row,
      address: { ...row.address, city: value as string },
    }),
  },
];

Exported Components

You can also use individual components:

import {
  DataGrid,
  GridToolbar,
  RecordModal,
  SelectEditor,
  DateEditor,
  createSelectEditor,
} from '@nacmias/data-grid';

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

# Type check
npm run typecheck

License

MIT