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

@manggala31/react-dashboard-grid

v1.1.0

Published

Production-ready, customizable drag-and-drop dashboard grid component for React, Inertia.js, and Next.js applications.

Readme

@manggala31/react-dashboard-grid

Production-ready, customizable drag-and-drop dashboard grid component for React, Laravel Inertia.js, and Next.js applications.

npm version license


Table of Contents


Overview

@manggala31/react-dashboard-grid is a modular, drag-and-drop dashboard grid framework. It allows users to position, resize, reorder, and persist customizable metric cards, chart containers, and analytics widgets. It bridges server-side widget configuration APIs (such as manggala/laravel-dashboard-builder) with a fluid React frontend UI.


Key Features

  • Responsive Grid Layout: 12-column responsive layout engine with configurable row heights and cell gaps.
  • Drag & Drop Reordering: Native HTML5 / pointer interaction for moving widgets across grid coordinates.
  • Layout State Persistence: Serialize layout coordinate state (JSON) to save user dashboard configurations to database or local storage.
  • Widget Customization: Supports custom title headers, action menus, refresh triggers, and custom component content.
  • Zero Heavy Dependencies: Lightweight footprint, optimized for React 18, React 19, Next.js, and Inertia.js.

Installation

# Using npm
npm install @manggala31/react-dashboard-grid

# Using yarn
yarn add @manggala31/react-dashboard-grid

# Using pnpm
pnpm add @manggala31/react-dashboard-grid

# Using bun
bun add @manggala31/react-dashboard-grid

Quick Start

import React, { useState } from 'react';
import { DashboardGrid, WidgetConfig } from '@manggala31/react-dashboard-grid';
import '@manggala31/react-dashboard-grid/styles.css';

const initialWidgets: WidgetConfig[] = [
  {
    id: 'widget-revenue',
    title: 'Monthly Revenue',
    colSpan: 4,
    rowSpan: 2,
    content: (
      <div className="metric-content">
        <h2>$45,280</h2>
        <span className="badge positive">+12.5% vs last month</span>
      </div>
    ),
  },
  {
    id: 'widget-users',
    title: 'Active Subscribers',
    colSpan: 4,
    rowSpan: 2,
    content: (
      <div className="metric-content">
        <h2>1,420</h2>
        <span className="badge positive">+8.3% growth</span>
      </div>
    ),
  },
  {
    id: 'widget-orders',
    title: 'Pending Orders',
    colSpan: 4,
    rowSpan: 2,
    content: (
      <div className="metric-content">
        <h2>38</h2>
        <span className="badge warning">Needs processing</span>
      </div>
    ),
  },
];

export default function AnalyticsDashboardPage() {
  const [widgets, setWidgets] = useState<WidgetConfig[]>(initialWidgets);

  const handleLayoutChange = (updatedWidgets: WidgetConfig[]) => {
    setWidgets(updatedWidgets);
    console.log('Saved layout state:', JSON.stringify(updatedWidgets));
  };

  return (
    <div className="container">
      <h1>Analytics Overview</h1>
      <DashboardGrid
        widgets={widgets}
        cols={12}
        isEditable
        onLayoutChange={handleLayoutChange}
      />
    </div>
  );
}

API Reference

<DashboardGrid> Props

| Prop | Type | Default | Description | |---|---|---|---| | widgets | WidgetConfig[] | Required | Array of widget configuration objects. | | cols | number | 12 | Grid column count. | | isEditable | boolean | true | Enable drag-and-drop reordering. | | onLayoutChange | (widgets: WidgetConfig[]) => void | undefined | Callback invoked when widget positions are updated. | | className | string | '' | Custom container CSS class. |

WidgetConfig Interface

export interface WidgetConfig {
  id: string;
  title?: string;
  colSpan?: number;
  rowSpan?: number;
  content: React.ReactNode;
  headerActions?: React.ReactNode;
}

Styling & Custom Themes

Default layout colors and borders can be customized via CSS variables:

:root {
  --dashboard-grid-gap: 16px;
  --widget-card-bg: #ffffff;
  --widget-card-border: #e2e8f0;
  --widget-card-text: #0f172a;
  --widget-card-radius: 12px;
}

License

MIT License © Ilham Hatta Manggala