
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@mindfiredigital/pivothead-react
Advanced tools
High-Performance Pivot Tables for React Applications
Features • Installation • Quick Start • Documentation • Examples • Support
🚀 Try it live: Interactive Demo | Example Projects
React-First Design
|
WebAssembly Powered
|
Flexible Rendering
|
Rich Features
|
Developer-Friendly
|
Framework Agnostic Core
|
# npm
npm install @mindfiredigital/pivothead-react
# yarn
yarn add @mindfiredigital/pivothead-react
# pnpm
pnpm add @mindfiredigital/pivothead-react
import { PivotHead } from '@mindfiredigital/pivothead-react';
// Your data
const salesData = [
{ product: 'Laptop', region: 'North', sales: 5000, quarter: 'Q1' },
{ product: 'Phone', region: 'South', sales: 3000, quarter: 'Q1' },
{ product: 'Tablet', region: 'East', sales: 2000, quarter: 'Q2' },
// ... more data
];
// Configuration
const pivotOptions = {
rows: ['product'],
columns: ['region'],
values: ['sales'],
};
export default function Dashboard() {
return (
<div>
<h1>Sales Dashboard</h1>
<PivotHead mode="default" data={salesData} options={pivotOptions} />
</div>
);
}
import { PivotHead } from '@mindfiredigital/pivothead-react';
import { useState } from 'react';
export default function CsvUploader() {
const [fileData, setFileData] = useState<File | null>(null);
const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (file) {
setFileData(file);
// The component automatically uses WebAssembly for optimal performance
// - Files < 8MB: Processed in-memory with WASM
// - Files > 8MB: Streaming + WASM hybrid mode
}
};
return (
<div>
<input type="file" accept=".csv" onChange={handleFileChange} />
{fileData && (
<PivotHead
mode="default"
data={fileData}
onStateChange={e => {
console.log('Performance mode:', e.detail.performanceMode);
// Possible values: 'standard', 'workers', 'wasm', 'streaming-wasm'
}}
/>
)}
</div>
);
}
Complete pivot table with built-in interface, drag-and-drop, filters, and controls.
<PivotHead mode="default" data={data} options={options} />
Best for: Quick implementation, prototyping, admin panels
Component provides structure; you control the styling and layout.
<PivotHead mode="minimal" data={data} options={options}>
<div slot="header">{/* Your custom toolbar */}</div>
<div slot="body">{/* Your custom table rendering */}</div>
</PivotHead>
Best for: Custom branding, unique designs, themed applications
No UI rendered - full programmatic control via API and events.
import { PivotHead } from '@mindfiredigital/pivothead-react';
import { useRef, useEffect, useState } from 'react';
export default function CustomPivot() {
const pivotRef = useRef<HTMLElement>(null);
const [state, setState] = useState(null);
useEffect(() => {
const handleStateChange = (e: CustomEvent) => {
setState(e.detail);
};
pivotRef.current?.addEventListener('stateChange', handleStateChange);
return () => {
pivotRef.current?.removeEventListener('stateChange', handleStateChange);
};
}, []);
return (
<div>
<PivotHead ref={pivotRef} mode="none" data={data} options={options} />
{/* Build your own UI using the state */}
{state && <YourCustomTable data={state.processedData} />}
</div>
);
}
Best for: Maximum flexibility, custom visualizations, advanced integrations
import { PivotHead } from '@mindfiredigital/pivothead-react';
import type {
PivotTableState,
PivotTableOptions,
} from '@mindfiredigital/pivothead';
interface SalesRecord {
product: string;
region: string;
sales: number;
date: string;
}
const options: PivotTableOptions = {
rows: ['product'],
columns: ['region'],
values: ['sales'],
};
export default function TypedPivot() {
const handleStateChange = (
event: CustomEvent<PivotTableState<SalesRecord>>
) => {
console.log('New state:', event.detail);
};
return (
<PivotHead<SalesRecord>
mode="default"
data={salesData}
options={options}
onStateChange={handleStateChange}
/>
);
}
import { PivotHead } from '@mindfiredigital/pivothead-react';
import { useRef } from 'react';
export default function MethodsExample() {
const pivotRef = useRef<any>(null);
const handleExportPDF = () => {
pivotRef.current?.exportToPDF('sales-report');
};
const handleExportExcel = () => {
pivotRef.current?.exportToExcel('sales-data');
};
const handleSort = (field: string) => {
pivotRef.current?.sort(field, 'desc');
};
return (
<div>
<div className="toolbar">
<button onClick={handleExportPDF}>Export PDF</button>
<button onClick={handleExportExcel}>Export Excel</button>
<button onClick={() => handleSort('sales')}>Sort by Sales</button>
</div>
<PivotHead ref={pivotRef} mode="default" data={data} options={options} />
</div>
);
}
import { PivotHead } from '@mindfiredigital/pivothead-react';
import { useState, useEffect } from 'react';
export default function LiveDashboard() {
const [data, setData] = useState([]);
useEffect(() => {
// Simulate real-time data updates
const interval = setInterval(() => {
fetch('/api/sales/latest')
.then(res => res.json())
.then(newData => setData(newData));
}, 5000);
return () => clearInterval(interval);
}, []);
return <PivotHead mode="default" data={data} options={options} />;
}
| Prop | Type | Default | Description |
|---|---|---|---|
mode | 'default' | 'minimal' | 'none' | 'default' | Rendering mode |
data | Array | File | string | [] | Data source (JSON array, CSV File, or JSON string) |
options | PivotTableOptions | string | {} | Pivot configuration |
filters | FilterConfig[] | string | [] | Active filters |
pagination | PaginationConfig | string | {} | Pagination settings |
onStateChange | (event: CustomEvent) => void | - | Fired when state changes |
Access methods via ref:
const pivotRef = useRef<any>(null);
// Methods
pivotRef.current?.getState(); // Get current state
pivotRef.current?.refresh(); // Refresh the pivot table
pivotRef.current?.sort(field, dir); // Sort by field
pivotRef.current?.exportToPDF(name); // Export to PDF
pivotRef.current?.exportToExcel(name); // Export to Excel
pivotRef.current?.exportToHTML(name); // Export to HTML
| Event | Payload | Description |
|---|---|---|
onStateChange | PivotTableState | Triggered on any state change (sort, filter, etc.) |
Check out complete working examples in the repository:
| Example | Description | Path |
|---|---|---|
| Default Mode | Full UI with all features enabled | react-web-component-demo |
| React Wrapper | React-specific implementation | react-demo |
| CSV Upload | Large file processing with WASM | simple-js-demo |
| Minimal Mode | Custom rendering with slots | pivothead-minimal-demo |
| Headless Mode | Complete control for custom visualizations | pivothead-none-demo |
# Clone the repository
git clone https://github.com/mindfiredigital/PivotHead.git
cd PivotHead
# Navigate to React demo
cd examples/react-demo
# Install dependencies
pnpm install
# Start development server
pnpm dev
| File Size | Processing Mode | Load Time | Memory Usage |
|---|---|---|---|
| < 1 MB | Standard | ~50ms | Low |
| 1-8 MB | Web Workers | ~200ms | Medium |
| 8-100 MB | WASM (in-memory) | ~800ms | Medium |
| 100MB-1GB | Streaming + WASM | ~3-5s | Low (chunked) |
All benchmarks run on Chrome 120, MacBook Pro M1, 16GB RAM
// app/dashboard/page.tsx
'use client';
import dynamic from 'next/dynamic';
const PivotHead = dynamic(
() => import('@mindfiredigital/pivothead-react').then(mod => mod.PivotHead),
{ ssr: false }
);
export default function DashboardPage() {
return <PivotHead mode="default" data={data} options={options} />;
}
// app/routes/dashboard.tsx
import { PivotHead } from '@mindfiredigital/pivothead-react';
import { useLoaderData } from '@remix-run/react';
export async function loader() {
const data = await fetchSalesData();
return { data };
}
export default function Dashboard() {
const { data } = useLoaderData();
return <PivotHead mode="default" data={data} options={options} />;
}
If PivotHead helps your project, please consider:
MIT © Mindfiredigital
Built with ❤️ by the Mindfiredigital team
FAQs
Unknown package
The npm package @mindfiredigital/pivothead-react receives a total of 122 weekly downloads. As such, @mindfiredigital/pivothead-react popularity was classified as not popular.
We found that @mindfiredigital/pivothead-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.