
Security News
npm v12 Ships With Install Scripts Off by Default, Begins Deprecating 2FA-Bypass Tokens
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.
Lightweight, headless, framework agnostic, feature rich, paginated, extensible, sortable, searchable data tables in plain js. Open-source & MIT licensed.
While the library is built for the Semantq JS Framework - AnyGrid is framework agnostic and can work with any JS Framework and vanilla JavaScript.
name and surname rendered as fullName) for enhanced readability and visualization.theme: 'blue') in the features object.themeColor: '#4f4f4d') in your features object.gridModal option to allow users to click on any row and view the full record details in a dedicated modal window.features object. e.g. dataApiEndPoint: 'http://localhost:3000/product/products',Easy & Quick Deployment: AnyGrid is designed for rapid deployment. All you need is your $data object, column definitions, and an optional features object to get started.
Multiple Grid Capability: Implement the capability to display multiple independent data grids on the same page, each with its own data and configurations.
Formique Integration: Works seamlessly with Formique, a robust code, low-code/no-code JavaScript-driven form builder, enabling you to write complete forms with robust inbuilt form submission logic without touching HTML or CSS.
On-the-Fly Export: Optionally enable CSV and Excel export formats for your data directly from the grid interface.
Sticky Table Headers: Keep headers visible while scrolling for better usability.
Framework Agnostic: Works with any JavaScript framework (Semantq, React, Angular, Vue, Svelte etc.) or vanilla JS.
Modularity and Features Optionality: Choose only the features you need for a lightweight and tailored implementation.
npm install anygridjs
Import into your project:
import AnyGrid from 'anygridjs';
Using AnyGrid in Non-Bundler Environments
If you're not using a bundler (or working in an environment that doesn't handle npm installs and ES module imports), you can simply include AnyGrid via CDN. Add the following <script> tag inside the <head> or just before the closing </body> tag of your HTML page:
<script src="https://cdn.jsdelivr.net/npm/anygridjs@1.0.13/anyGrid.global.min.js"></script>
This will make AnyGrid available globally as a browser-friendly script.
Get the AnyGrid css via the cdn link.
<link rel="stylesheet" href="https://unpkg.com/anygridcss@1.0.2/anyGrid.css" />
In a Semantq project you can place that stylesheet link tag inside the @head ...link tag here.. @end section of your @layout.smq page inside the route where you want to use AnyGrid.
You would have created the route this way:
semantq make:route products -l
this will create a dir:
src/routes/products
inside that directory there would two files
@page.smq and @layout.smq
For more on this you can view the Semantq Layouts Guide here
<div id="anygrid"></div>
You can also use any id that you prefer e.g.
<div id="users"></div>
In this case, you will have to define the target container id in the features object as shown below:
const features = {
gridContainerId: 'users'
}
If the id of your target grid container is 'anygrid' then you do not need to define the gridConatinerId in the features object.
const data = [
{ id: 1, name: 'John', surname: 'Doe', age: 30, role: 'Developer', salary: 50000 },
{ id: 2, name: 'Jane', surname: 'Doe', age: 28, role: 'Designer', salary: 45000 },
{ id: 3, name: 'Jack', surname: 'Smith', age: 34, role: 'Product Manager', salary: 60000 },
{ id: 4, name: 'Emily', surname: 'Jones', age: 27, role: 'Marketing Specialist', salary: 47000 },
// add more records
];
const columns = [
{ name: 'id', header: 'ID', render: (value, row) => `<a href="/user/profile/${row.id}">${row.id}</a>`, sortable: true },
{ name: 'fullName', header: 'FULL NAME', joinedColumns: ['name', 'surname'] },
{ name: 'age', header: 'AGE', sortable: true },
{ name: 'role', header: 'ROLE' },
{ name: 'salary', header: 'SALARY', render: '<strong>R{salary}</strong>', sortable: true,
actions: [
{
label: 'EDIT',
url: 'edit/{id}',
class: 'edit',
id: 'edit-{id}',
},
{
label: 'DELETE',
url: 'delete/{id}',
class: 'delete',
id: 'delete-{id}',
confirm: true,
},
],
},
];
const features = {
initialItemsPerPage: 30,
csvExport: true,
excelExport: true,
theme: 'pink',
gridModal:true,
modalConfig {
editable: true,
deletable:true,
nonEditableFields:['id']
}
}
const dataGrid = new AnyGrid(data, columns, features);
const dataGrid = new AnyGrid(data, columns);
// data object (JSON)
const data = [
{ id: 1, name: 'John', surname: 'Doe', age: 30, role: 'Developer', salary: 50000 },
{ id: 2, name: 'Jane', surname: 'Doe', age: 28, role: 'Designer', salary: 45000 },
{ id: 3, name: 'Jack', surname: 'Smith', age: 34, role: 'Product Manager', salary: 60000 }
// Additional data trimmed for brevity
];
const columns = [
{ name: 'id', header: 'ID', render: (value, row) => `<a href="/user/profile/${row.id}">${row.id}</a>`, sortable: true },
{ name: 'fullName', header: 'FULL NAME', joinedColumns: ['name', 'surname'] },
{ name: 'age', header: 'AGE', sortable: true },
{ name: 'role', header: 'ROLE' },
{ name: 'salary', header: 'SALARY', render: '<strong>R{salary}</strong>', sortable: true,
actions: [
{
label: 'EDIT',
url: 'edit/{id}',
class: 'edit',
id: 'edit-{id}',
},
{
label: 'DELETE',
url: 'delete/{id}',
class: 'delete',
id: 'delete-{id}',
confirm: true,
},
],
},
];
// create a new instance of AnyGrid
const dataGrid = new anyGrid(data, columns);
AnyGrid has these in built features enabled by default: search/filter, sort, actions (row actions like edit or delete), pagination, items per page, dynamic headers and initial items per page. Therefore you do not need to declare them in the features object. However, AnyGrid gives the option to disable these features if you don't need them. Below is an example of how you can disable these features.
const features = {
search: false,
sort: false,
actions: false,
pagination: false,
itemsPerPage: false,
dynamicHeaders: false,
}
AnyGrid is a headless JS library - meaning the library can still work without any CSS and the styling is entirely up to you. However as an option we offer a basic and high end css themes to enhance the look and feel of your data tables. If you want to use the provided css just deploy anyGrid.css via this cdn link as demonstated earlier in the docs.
AnyGrid css offer these color themes: default (dark), light, blue, pink, dark-orange, green and indigo.
You can define your preferred color theme on the features object this way:
const features = {
theme: 'pink'
}
Use @semantq/ql for fetching and submitting data efficiently.
npm install @semantq/ql
import smQL from '@semantq/ql';
const records = await new smQL(API_END_POINT);
smQLhandles GET, POST, PUT, DELETE behind the scenes and simplifies async handling. It's recommended to declareAPI_END_POINT(e.g.http://localhost:3000/product/products) as a constant or environment variable for maintainability.
In the SemantqQL full-stack project, the API routes for editing and deleting records follow a consistent structure:
{server_url} / {model_name (lowercase)} / {route_name}
For example, if you create this resource:
semantq make:resource Product
The API endpoint for editing or deleting records would look like:
http://localhost:3000/product/products
Note that http://localhost:3000/ is just an example.
You can always confirm or modify these routes by checking the semantqQL/server/routes/modelRoutes.js file.
const features = {
initialItemsPerPage: 5,
csvExport: true,
excelExport: true,
theme: 'indigo', // Optional: Built-in colour themes like 'indigo', 'green', 'slate', etc.
themeColor: '#556B2F', // Optional: Custom HEX colour to override built-in theme
gridModal: true, // NEW: Enables row-click modal interaction
modalConfig: {
editable: true, // Show "Edit" button in modal
deletable: true, // Show "Delete" button in modal
nonEditableFields: [ // Optional: Fields excluded from edit view
'id', 'uuid', 'status',
'sortOrder', 'createdAt', 'updatedAt'
]
},
dataApiEndPoint: 'http://localhost:3000/product/products', // For update/delete actions
};
gridModal (Default: false)modalConfig:| Option | Description |
|---|---|
editable | Enables "Edit" button inside the modal |
deletable | Enables "Delete" button inside the modal |
nonEditableFields | Prevents editing of specified fields |
dataApiEndPoint// Example:
PUT /product/products/6
DELETE /product/products/6
themeColor#556B2F) - this will override the theme if a theme is also defined in the features object.AnyGrid styles and themes come with block table style for mobile screen displays. See example below:
AVAILABLE IN BUILT THEMES (List is to be extended)
By default, AnyGrid will place your data grid in the element with the id: anygrid eg:
<div id="anygrid">Your data grid will be displayd here</div>
However using custom container ids can be useful particularly if you want to display more than one data grids on the same page. See below.
<div id="users"></div>
Having defined your data and columns for your AnyGrid instance you can then invoke the AnyGrid class with the custom container id parameter:
const containerId='users';
const dataGrid = new anyGrid(data, columns, features);
//or without the features object
const dataGrid = new anyGrid(data, columns);
You need to use this approach for every instance of AnyGrid you need to implement on your page.
AnyGrid is primarily an open-source project. Contributions, issues, and feature requests are welcome!
AnyGrid is licensed under the MIT License.
Danko! Ngyabonga -:)
FAQs
Lightweight, headless, framework agnostic, feature rich, paginated, extensible, sortable, searchable data tables in plain js. Open-source & MIT licensed.
The npm package anygridjs receives a total of 12 weekly downloads. As such, anygridjs popularity was classified as not popular.
We found that anygridjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.

Research
/Security News
Socket tracks the activity as Operation “Muck and Load”: a threat actor uses commit-farming workflows, public dead drops, and protected archives to stage Windows RAT and infostealer malware.

Security News
pnpm 11.10 hardens registry auth to block token redirection, tightens pack-app and deploy, and makes the Rust port (v12) installable.