
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@blocktion/json-to-table
Advanced tools
A powerful, modular React component for converting JSON data to navigable tables with advanced features like automatic column detection, theming, and sub-table navigation. Part of the Blocktion SaaS project ecosystem.
A powerful, modular React component for converting JSON data to navigable tables with advanced features like automatic column detection, theming, array merging, type detection, and sub-table navigation. This component is part of the Blocktion platform ecosystem.
Note: This component was originally developed for the Blocktion platform - an intelligent workflow automation platform. We've open-sourced this component for anyone to use in their React projects. Read the root folder README to understand what Blocktion is.
npm install @blocktion/json-to-table
This package is designed with modularity in mind. You can import only what you need:
// Main component
import { JsonTable } from "@blocktion/json-to-table";
// Individual components
import {
TableContainer,
TableHeader,
TableBody,
} from "@blocktion/json-to-table/components";
// Hooks
import {
useTableData,
useSorting,
usePagination,
} from "@blocktion/json-to-table/hooks";
// Themes
import {
defaultTheme,
darkTheme,
minimalTheme,
} from "@blocktion/json-to-table/themes";
// Utilities
import { ArrayAnalyzer, ObjectUtils } from "@blocktion/json-to-table/utils";
import { JsonTable } from "@blocktion/json-to-table";
const data = [
{ id: 1, name: "John", age: 30, email: "john@example.com" },
{ id: 2, name: "Jane", age: 25, email: "jane@example.com" },
];
function App() {
return (
<JsonTable
data={data}
title="Users"
options={{
maxDepth: 2,
enableSorting: true,
enableNavigation: true,
}}
/>
);
}
import React, { useState } from "react";
import { JsonTable } from "@parallaxsolutions/json-to-table";
const data = [
{
id: 1,
name: "John Doe",
email: "john@example.com",
age: 30,
isActive: true,
salary: 75000,
department: "Engineering",
tags: ["developer", "react"],
},
];
function EditableApp() {
const [tableData, setTableData] = useState(data);
const handleDataChange = (newData, changes) => {
console.log("Data changed:", changes);
setTableData(newData);
};
const validationRules = [
{
field: "email",
validator: (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value),
message: "Invalid email format",
},
{
field: "age",
validator: (value) => value >= 18 && value <= 100,
message: "Age must be between 18 and 100",
},
];
return (
<JsonTable
data={tableData}
title="Editable Users Table"
options={{
// Core features
enableSorting: true,
enableNavigation: true,
enablePagination: true,
showRowNumbers: true,
// Editing features
enableEditing: true,
enableRowDeletion: true,
enableFieldEditing: true,
enableFieldDeletion: true,
enableInlineEditing: true,
enableBulkOperations: true,
editMode: "inline",
validationRules,
}}
onDataChange={handleDataChange}
onRowAdd={(rowIndex, row) => console.log("Row added:", rowIndex)}
onRowDelete={(rowIndex, row) => console.log("Row deleted:", rowIndex)}
onFieldUpdate={(rowIndex, field, newValue, oldValue) =>
console.log("Field updated:", { rowIndex, field, newValue, oldValue })
}
customRenderers={{
email: (value) => (
<a href={`mailto:${value}`} className="text-blue-600 underline">
{value}
</a>
),
isActive: (value) => (
<span className={value ? "text-green-600" : "text-red-600"}>
{value ? "Active" : "Inactive"}
</span>
),
}}
/>
);
}
import { JsonTable } from "@blocktion/json-to-table";
const data = [
{
id: 1,
name: "John Doe",
profile: {
email: "john@example.com",
settings: { theme: "dark", notifications: true },
},
hobbies: ["reading", "swimming"],
isActive: true,
lastLogin: "2024-01-15T10:30:00Z",
},
];
function App() {
return (
<JsonTable
data={data}
title="Advanced Users Table"
options={{
maxDepth: 3,
enableSorting: true,
enableNavigation: true,
enablePagination: true,
enableFiltering: true,
mergeRepeatedColumns: true,
pageSize: 10,
showRowNumbers: true,
}}
onRowClick={(row, index) => console.log("Row clicked:", row)}
onCellClick={(value, column, row) => console.log("Cell clicked:", value)}
customRenderers={{
email: (value) => (
<a href={`mailto:${value}`} className="text-blue-600 underline">
{value}
</a>
),
isActive: (value) => (
<span className={value ? "text-green-600" : "text-red-600"}>
{value ? "Active" : "Inactive"}
</span>
),
}}
/>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
data | unknown[] | - | Array of objects to display in the table |
title | string | "Data Table" | Title displayed above the table |
className | string | "" | Additional CSS classes |
options | TableOptions | {} | Table configuration options |
theme | 'default' | 'minimal' | 'dark' | 'default' | Theme for the table |
onRowClick | (row: unknown, index: number) => void | - | Callback when a row is clicked |
onCellClick | (value: unknown, column: Column, row: unknown) => void | - | Callback when a cell is clicked |
customRenderers | Record<string, (value: unknown, row: unknown) => React.ReactNode> | {} | Custom cell renderers |
| Option | Type | Default | Description |
|---|---|---|---|
maxDepth | number | 2 | Maximum depth for nested object exploration |
enableSorting | boolean | true | Enable column sorting |
enableFiltering | boolean | false | Enable data filtering |
enablePagination | boolean | false | Enable pagination |
enableNavigation | boolean | true | Enable sub-table navigation |
mergeRepeatedColumns | boolean | false | Merge repeated columns into arrays |
pageSize | number | 50 | Number of rows per page |
showRowNumbers | boolean | false | Show row numbers |
showColumnCount | boolean | true | Show column count |
showRowCount | boolean | true | Show row count |
The component uses Tailwind CSS classes. Make sure Tailwind CSS is available in your project for proper styling.
<JsonTable
data={data}
theme="dark" // or "minimal"
className="custom-table"
/>
<JsonTable
data={data}
customRenderers={{
status: (value) => (
<span
className={`badge ${value === "active" ? "badge-success" : "badge-error"}`}
>
{value}
</span>
),
avatar: (value) => (
<img src={value} alt="Avatar" className="w-8 h-8 rounded-full" />
),
}}
/>
When mergeRepeatedColumns is enabled, the table will automatically merge repeated column values into arrays:
const data = [
{ id: 1, name: "John", tags: ["developer"] },
{ id: 2, name: "Jane", tags: ["designer"] },
{ id: 3, name: "Bob", tags: ["manager"] },
{ id: 4, name: "Alice", tags: ["developer", "designer"] },
];
<JsonTable data={data} options={{ mergeRepeatedColumns: true }} />;
The table automatically detects data types and provides appropriate sorting and filtering:
<JsonTable
data={data}
options={{ enableFiltering: true }}
// Filtering is handled internally, but you can access filter state
onFilterChange={(filters) => console.log("Filters changed:", filters)}
/>
The component is optimized for performance with:
This package is part of the Blocktion platform - an intelligent workflow automation platform that enables you to create, manage, and execute complex workflows through a powerful combination of visual design and advanced orchestration.
Blocktion is a sophisticated, enterprise-grade workflow automation platform that transforms complex automation challenges into simple, visual workflows. This JSON-to-table component was originally developed for Blocktion's data exploration and visualization features and is now available to the open-source community.
Read the root folder README to learn more about Blocktion's full capabilities, including:
We welcome contributions from the community! Please feel free to:
git clone https://github.com/blocktion/json-to-table.git
cd json-to-table
npm install
npm run dev
MIT License - see LICENSE file for details.
For support, questions, or business inquiries:
FAQs
A powerful, modular React component for converting JSON data to navigable tables with advanced features like automatic column detection, theming, and sub-table navigation. Part of the Blocktion SaaS project ecosystem.
We found that @blocktion/json-to-table 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.