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

@kumaran_bk/test-dashboard

v1.0.0

Published

A React-based draggable dashboard powered by GridStack.js, optimized for Next.js integration

Readme

Apptimus Dashboard

A React-based draggable dashboard powered by GridStack.js, optimized for Next.js integration.

Features

  • 🎯 Five Widget Types: TEXT, NUMBER, CHART, TABLE, and IMAGE
  • 🖱️ Drag & Drop: Intuitive drag-and-drop interface for rearranging widgets
  • 📱 Responsive: Mobile-friendly layouts with GridStack.js
  • 🔧 Customizable: Flexible grid options and widget positioning
  • 💾 Persistent: Save and load dashboard layouts
  • Next.js Ready: SSR compatible with ESM/CJS outputs

Installation

npm install apptimus-dashboard

Peer Dependencies

This package requires the following peer dependencies:

npm install @apptimus-ui/modal@^1.0.0 @apptimus-ui/table@* @apptimus-ui/theme@^1.3.0

Quick Start

import { DraggableDashboard } from 'apptimus-dashboard';
import TextWidget from './TextWidget';

function MyDashboard() {
  const [widgets, setWidgets] = useState([
    {
      id: '1',
      type: 'TEXT',
      x: 0,
      y: 0,
      w: 4,
      h: 2,
      content: <TextWidget text="Dashboard" />
    }
  ]);

  const handleLayoutChange = (layout) => {
    // Save layout to your backend or state
    console.log('Layout changed:', layout);
  };

  return (
    <DraggableDashboard
      widgets={widgets}
      onLayoutChange={handleLayoutChange}
    />
  );
}

Props

DraggableDashboardProps

| Prop | Type | Required | Description | |------|------|----------|-------------| | widgets | DashboardWidget[] | Yes | Array of widgets to display | | onAddWidget | (type: string) => void | No | Callback when adding a new widget | | onRemoveWidget | (id: string) => void | No | Callback when removing a widget | | onLayoutChange | (layout: GridStackNode[]) => void | No | Callback when layout changes | | gridOptions | Partial<GridStackOptions> | No | Custom GridStack options |

DashboardWidget

interface DashboardWidget {
  id: string;
  type: 'TEXT' | 'NUMBER' | 'CHART' | 'TABLE' | 'IMAGE';
  x: number;        // Grid X position
  y: number;        // Grid Y position
  w: number;        // Width in grid units
  h: number;        // Height in grid units
  content: ReactNode; // React component to render
}

Usage Examples

Basic Dashboard

import { DraggableDashboard } from 'apptimus-dashboard';

const widgets = [
  {
    id: '1',
    type: 'TEXT',
    x: 0,
    y: 0,
    w: 4,
    h: 2,
    content: <div>Hello World</div>
  },
  {
    id: '2',
    type: 'CHART',
    x: 4,
    y: 0,
    w: 8,
    h: 4,
    content: <ChartComponent data={chartData} />
  }
];

<DraggableDashboard widgets={widgets} />

With Layout Persistence

import { useState, useEffect } from 'react';
import { DraggableDashboard } from 'apptimus-dashboard';

function Dashboard() {
  const [widgets, setWidgets] = useState([]);

  // Load saved layout
  useEffect(() => {
    const saved = localStorage.getItem('dashboard-layout');
    if (saved) {
      setWidgets(JSON.parse(saved));
    }
  }, []);

  // Save layout changes
  const handleLayoutChange = (layout) => {
    const updated = widgets.map(widget => {
      const layoutItem = layout.find(item => item.id === widget.id);
      if (layoutItem) {
        return {
          ...widget,
          x: layoutItem.x || 0,
          y: layoutItem.y || 0,
          w: layoutItem.w || 4,
          h: layoutItem.h || 2,
        };
      }
      return widget;
    });
    setWidgets(updated);
    localStorage.setItem('dashboard-layout', JSON.stringify(updated));
  };

  return (
    <DraggableDashboard
      widgets={widgets}
      onLayoutChange={handleLayoutChange}
    />
  );
}

Custom Grid Options

<DraggableDashboard
  widgets={widgets}
  gridOptions={{
    column: 16,        // 16-column grid
    cellHeight: 100,   // Taller cells
    margin: 5,         // Smaller margins
    disableResize: false,
    disableDrag: false,
    animate: true,
  }}
/>

Adding Widgets with Modal

import { useState } from 'react';
import { Modal } from '@apptimus-ui/modal';
import { DraggableDashboard } from 'apptimus-dashboard';

function DashboardWithAdd() {
  const [widgets, setWidgets] = useState([]);
  const [showModal, setShowModal] = useState(false);

  const handleAddWidget = (type) => {
    const newWidget = {
      id: Date.now().toString(),
      type,
      x: 0,
      y: 0,
      w: 4,
      h: 2,
      content: <WidgetComponent type={type} />
    };
    setWidgets([...widgets, newWidget]);
    setShowModal(false);
  };

  return (
    <>
      <button onClick={() => setShowModal(true)}>Add Widget</button>
      <DraggableDashboard
        widgets={widgets}
        onAddWidget={handleAddWidget}
      />
      {showModal && (
        <Modal onClose={() => setShowModal(false)}>
          <WidgetTypeSelector onSelect={handleAddWidget} />
        </Modal>
      )}
    </>
  );
}

Widget Types

The dashboard supports five widget types. You provide the React components:

  • TEXT: Text-based widgets
  • NUMBER: Numeric displays
  • CHART: Chart visualizations
  • TABLE: Data tables (use @apptimus-ui/table)
  • IMAGE: Image displays

GridStack Options

You can customize the grid behavior using gridOptions. Common options:

  • column: Number of columns (default: 12)
  • cellHeight: Height of each cell in pixels (default: 70)
  • margin: Margin between cells (default: 10)
  • disableResize: Disable widget resizing
  • disableDrag: Disable widget dragging
  • animate: Enable animations

See GridStack documentation for all options.

TypeScript

Full TypeScript support is included:

import type {
  DraggableDashboardProps,
  DashboardWidget,
  WidgetType,
} from 'apptimus-dashboard';

Next.js Integration

The package is optimized for Next.js with:

  • SSR compatibility
  • 'use client' directive for client components
  • ESM and CJS build outputs

License

MIT