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

mobigrid-module

v1.1.31

Published

A flexible and customizable data table interface module with advanced filtering, column management, and action handling capabilities.

Readme

mobigrid-module

A flexible and customizable data table interface module with advanced filtering, column management, and action handling capabilities.

Installation

npm install mobigrid-module

Usage

You can use the MobigridModule component by importing it into your React application.

import MobigridModule from 'mobigrid-module';
import 'mobigrid-module/dist/index.css'; // Import styles if necessary

function App() {
  const handleEdit = (row) => {
    console.log('Edit row:', row);
  };

  const handleDelete = (row) => {
    console.log('Delete row:', row);
  };

  const checkEditPermission = (row) => {
    return row.status !== 'LOCKED';
  };

  return (
    <MobigridModule
      configUrl="https://api.example.com/config"
      // OR provide configJson directly
      // configJson={myConfigObject}
      dataUrl="https://api.example.com/data"
      callbacks={{
        onEdit: handleEdit,
        onDelete: handleDelete,
        canEdit: checkEditPermission
      }}
      customHeaders={{
        'Authorization': 'Bearer token123'
      }}
    />
  );
}

Component Props

The MobigridModule accepts the following props:

| Prop | Type | Description | |------|------|-------------| | configUrl | string | URL to fetch the configuration JSON from. | | configJson | object | Direct configuration object. Use this or configUrl. | | dataUrl | string | URL to fetch the table data from. Overrides data_url in config. | | preJsUrl | string | URL to fetch a JavaScript file to execute before rendering (e.g., for global functions). | | preJs | string | Direct JavaScript code string to execute. | | callbacks | object | An object containing functions referenced by action buttons or conditions. | | customHeaders | object | Custom HTTP headers to include in API requests (data and config). | | itemsPerPage | number | Number of items to display per page (default: 14). | | dateFormat | string | Format string for dates in API requests (default: "MM-dd-yyyy HH:mm"). | | children | ReactNode | Child components to render at the bottom of the module. |

Configuration Structure

The configuration object defines the structure of the table, filters, and columns. You can provide this via the configUrl endpoint or directly via the configJson prop.

{
  "title": "User Management",
  "data_url": "https://api.example.com/users",
  "Filters": [
    [
      {
        "type": "Text",
        "name": "search",
        "label": "Search Users"
      },
      {
        "type": "Select",
        "name": "role",
        "label": "Role",
        "urlSource": "https://api.example.com/roles" // Dynamic options
      }
    ],
    [
      {
        "type": "Date",
        "name": "fromDate",
        "label": "From Date"
      },
       {
        "type": "Date",
        "name": "toDate",
        "label": "To Date"
      }
    ]
  ],
  "colomns": [ // Note: spelling is 'colomns' in current version
    {
      "title": "Name",
      "key": "fullName",
      "type": "text"
    },
    {
      "title": "Status",
      "key": "status",
      "type": "status"
    },
    {
      "title": "Created At",
      "key": "createdAt",
      "type": "date",
      "pattern": "dd/MM/yyyy"
    },
    {
      "title": "Actions",
      "key": "ACTIONS_BUTTONS",
      "actions": [
        {
          "label": "Edit",
          "icon": "icon-edit",
          "action": "onEdit",
          "condition": "canEdit"
        }
      ]
    }
  ]
}

Filters Configuration

Filters are defined as an array of arrays (rows of filters).

  • type: The type of filter. Supported types:
    • "Text": Simple text input.
    • "Select": Dropdown menu. Use urlSource for dynamic options or options for static ones.
    • "Date": Date picker.
  • name: The query parameter key that will be sent to the data_url.
  • label: The label displayed for the filter.
  • urlSource: (For Select type) URL to fetch options from. Expects an array of objects { label, value }.
  • options: (For Select type) Static array of options { label, value }.

Columns Configuration (colomns)

Defines the table columns.

  • title: Header text for the column.
  • key: The key in the data object to display.
  • type: formatting type.
    • "text": Default display.
    • "date": Formats date using pattern (default: dd-MM-yyyy).
    • "money": Formats as currency. Usage: currency prop required.
    • "status": Displays a colored badge based on status value (PENDING, PAID, CANCELLED, etc.).
    • "ACTIONS_BUTTONS": Special column for action buttons.
  • scroll: If true, limits height and adds scrollbar for long content.

Actions Configuration

For columns with key: "ACTIONS_BUTTONS", you can define an actions array.

  • label: Text on the button.
  • icon: Icon name (referenced from Feather icons, prefixed with icon-).
  • action: The name of the callback function in the callbacks prop to execute on click. receives the row data.
  • condition: (Optional) The name of the callback function in the callbacks prop to determine visibility. Receives row data and must return boolean.

Development

To build the project:

npm run build

To deploy (build, version bump, publish, and push):

# Default bump is patch
./deploy.sh

# Specify bump type
./deploy.sh minor