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

vanilla-data-grid-lite

v1.0.0

Published

Framework-agnostic configurable data grid using HTML, CSS and JavaScript

Downloads

109

Readme

Vanilla Data Grid Lite

A lightweight, framework-agnostic data grid that works perfectly with React.

✨ Features

  • Sorting - Click column headers to sort
  • Filtering - Built-in column filters
  • Pagination - Configurable page sizes
  • Global Search - Search across all columns
  • Column Resize - Drag to resize columns
  • Column Reorder - Drag to reorder columns
  • Column Chooser - Show/hide columns
  • Export - Excel & PDF export
  • Row Selection - Optional checkbox selection
  • Responsive - Works on all screen sizes

All features enabled by default! Just add data and you're done.


Installation

npm install vanilla-data-grid-lite

Quick Start (React)

Minimal Usage (Auto-Generated Columns)

import { useEffect } from 'react';
import { Grid } from 'vanilla-data-grid-lite';
import 'vanilla-data-grid-lite/dist/vanilla-data-grid.css';

export default function App() {
  useEffect(() => {
    const data = [
      { id: 1, name: 'Alice', age: 24, department: 'Engineering' },
      { id: 2, name: 'Bob', age: 30, department: 'Marketing' },
      { id: 3, name: 'Charlie', age: 28, department: 'Sales' }
    ];

    // Just container + data. Columns auto-generated from data!
    new Grid({
      container: '#grid',
      dataSource: { type: 'static', data }
    });
  }, []);

  return <div id="grid"></div>;
}

With Title

new Grid({
  container: '#grid',
  title: 'Employee Directory',
  dataSource: { type: 'static', data }
});

With Custom Columns

new Grid({
  container: '#grid',
  title: 'Employees',
  columns: [
    { headerText: 'ID', dataField: 'id' },
    { headerText: 'Name', dataField: 'name' },
    { headerText: 'Age', dataField: 'age' },
    { headerText: 'Department', dataField: 'department' }
  ],
  dataSource: { type: 'static', data }
});

Configuration

Required Options

{
  container: '#grid',           // CSS selector or DOM element
  dataSource: {
    type: 'static',             // 'static', 'api', or 'function'
    data: [...]                 // Array of objects
  }
}

Optional Options

{
  title: 'My Grid',             // Grid title (shown in toolbar)
  
  columns: [                    // Optional - auto-generated if not provided
    {
      headerText: 'Column Name',
      dataField: 'fieldName',
      sortable: true,           // Default: true
      filterable: true,         // Default: true
      dataType: 'string',       // 'string', 'number', 'date'
      width: 150                // Column width in pixels
    }
  ],

  features: {
    sorting: true,              // Enable/disable sorting
    filtering: true,            // Enable/disable filtering
    pagination: true,           // Enable/disable pagination
    columnResize: true,         // Enable/disable column resize
    columnReorder: true,        // Enable/disable column reorder
    rowSelection: true          // Enable/disable row selection
  },

  pagination: {
    enabled: true,
    pageSize: 10,               // Rows per page
    pageSizes: [10, 25, 50, 100] // Available page sizes
  },

  globalSearch: {
    enabled: true,
    placeholder: 'Search...',
    debounce: 250               // Milliseconds
  },

  columnChooser: {
    enabled: true,              // Show/hide columns UI
    label: 'Columns'
  },

  export: {
    enabled: true,
    formats: ['excel', 'pdf']   // Export formats
  },

  selection: {
    enabled: false,             // Enable row selection
    type: 'checkbox',           // 'checkbox' or 'row'
    mode: 'multiple'            // 'single' or 'multiple'
  },

  theme: {
    mode: 'light',              // 'light' or 'dark'
    accentColor: '#0078d4'      // Primary color
  }
}

API Data Source

new Grid({
  container: '#grid',
  dataSource: {
    type: 'api',
    url: 'https://api.example.com/employees',
    method: 'GET',
    headers: {
      'Authorization': 'Bearer token'
    },
    dataPath: 'data.items',     // If data is nested in response
    totalPath: 'data.total'     // If total count in response
  }
});

Events

new Grid({
  container: '#grid',
  dataSource: { type: 'static', data },
  events: {
    onDataLoaded: (data) => console.log('Data loaded', data),
    onRowClick: (row) => console.log('Row clicked', row),
    onSortChange: (column, direction) => console.log('Sorted by', column),
    onFilterChange: (filters) => console.log('Filters applied', filters),
    onPageChange: (page) => console.log('Page changed to', page),
    onSelectionChange: (selectedRows) => console.log('Selected', selectedRows)
  }
});

Examples

Disable Export

new Grid({
  container: '#grid',
  dataSource: { type: 'static', data },
  export: { enabled: false }   // Hide export buttons
});

Custom Pagination

new Grid({
  container: '#grid',
  dataSource: { type: 'static', data },
  pagination: {
    pageSize: 25,              // 25 rows per page
    pageSizes: [10, 25, 50]    // Allow user to change
  }
});

Disable Sorting & Filtering

new Grid({
  container: '#grid',
  dataSource: { type: 'static', data },
  features: {
    sorting: false,
    filtering: false
  }
});

Enable Row Selection

new Grid({
  container: '#grid',
  dataSource: { type: 'static', data },
  selection: {
    enabled: true,
    type: 'checkbox',
    mode: 'multiple'
  }
});

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT