
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.
follow-table
Advanced tools
A flexible and feature-rich React table component with data stewardship capabilities.
npm install follow-table
# or
yarn add follow-table
import { FollowTable } from 'follow-table';
import 'follow-table/dist/index.css'; // Import styles if needed
function MyComponent() {
const columns = ['id', 'name', 'email', 'role'];
const data = [
{ id: 1, name: 'John Doe', email: 'john@example.com', role: 'Admin' },
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', role: 'User' },
// more data...
];
return (
<FollowTable
columns={columns}
data={data}
idField="id"
/>
);
}
import { FollowTable } from 'follow-table';
function ApiTable() {
return (
<FollowTable
databaseId={1}
tableName="users"
idField="id"
actions={['select', 'view', 'edit', 'delete', 'export']}
actionHandlers={{
onView: (id, rowData) => console.log(`Viewing row ${id}`, rowData),
onEdit: (id) => console.log(`Editing row ${id}`),
onDelete: (id) => console.log(`Deleting row ${id}`),
onExport: (id) => console.log(`Exporting row ${id}`),
}}
layoutOptions={{
maxHeight: '600px',
stickyHeader: true,
fullHeight: true
}}
/>
);
}
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
columns | string[] | No | [] | Array of column names to display. If not provided, will be extracted from data. |
data | any[] | No | [] | Array of data objects. If not provided, data will be fetched from API. |
idField | string | No | 'rowid' | Field name to use as unique identifier. Defaults to 'rowid' for SQLite data. |
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId | string | number | No* | - | Database ID for API integration. Required if data is not provided. |
tableName | string | No* | - | Table name for API integration. Required if data is not provided. |
originalFileName | string | No | - | Original file name to display in the table header. |
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
actions | string[] | No | [] | Array of actions to enable. Options: 'select', 'view', 'edit', 'delete', 'export'. |
actionHandlers | object | No | {} | Object of handler functions for actions. Supports: onView, onEdit, onDelete, onSelect, onExport. |
onBulkDelete | function | No | - | Handler for bulk delete action. Receives array of selected row IDs. |
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
sortBy | string | No | '' | Initial column to sort by. |
order | 'asc' | 'desc' | No | 'asc' | Initial sort direction. |
handleSort | function | No | - | Custom sort handler. Receives column name as parameter. |
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
page | number | No | 1 | Current page number. |
totalPages | number | No | 1 | Total number of pages. |
pageSize | number | No | 20 | Number of rows per page. |
totalRows | number | No | 0 | Total number of rows across all pages. |
handlePageChange | function | No | - | Custom page change handler. Receives page number as parameter. |
handlePageSizeChange | function | No | - | Custom page size change handler. Receives event object. |
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
filters | object | No | {} | Column filters in format { columnName: filterValue }. |
applyFilter | function | No | - | Custom filter application handler. Receives column name and filter value. |
clearFilter | function | No | - | Custom filter clearing handler. Receives column name. |
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
layoutOptions | object | No | {} | Layout configuration options. |
layoutOptions.isStatsPanelOpen | boolean | No | false | Whether the stats panel is initially open. |
layoutOptions.maxHeight | string | number | No | 'calc(100% - 115px)' | Maximum height of the table body. |
layoutOptions.stickyHeader | boolean | No | true | Whether the table header should stick to the top when scrolling. |
layoutOptions.fullHeight | boolean | No | false | Whether the table should take full available height. |
layoutOptions.minHeight | string | number | No | - | Minimum height of the table. |
layoutOptions.responsiveBreakpoint | string | No | - | Custom breakpoint for responsive behavior. |
useTableDataHook to fetch and manage table data.
import { useTableData } from 'follow-table';
function MyComponent() {
const {
tableData,
setTableData,
sortBy,
setSortBy,
order,
setOrder,
page,
setPage,
pageSize,
setPageSize,
totalRows,
setTotalRows,
totalPages,
setTotalPages,
fetchData,
} = useTableData(
initialData, // optional: initial data array
databaseId, // optional: database ID
tableName, // optional: table name
externalSortBy, // optional: controlled sort column
externalOrder, // optional: controlled sort direction
externalPage, // optional: controlled page number
externalPageSize, // optional: controlled page size
externalTotalRows, // optional: controlled total rows count
externalTotalPages, // optional: controlled total pages count
filters // optional: column filters
);
// rest of your component...
}
useRowSelectionHook to manage row selection.
import { useRowSelection } from 'follow-table';
function MyComponent() {
const {
selectedRows, // Set of selected row IDs
setSelectedRows, // Function to manually set selected rows
onRowSelect, // Function to toggle selection of a single row
isAllSelected, // Boolean indicating if all rows are selected
onToggleSelectAll, // Function to toggle selection of all rows
} = useRowSelection(tableData, idField);
// rest of your component...
}
The library also exports individual components that can be used separately:
import {
TableHeader,
TableBody,
TableControls,
ViewModal,
StatsSidePanel
} from 'follow-table';
import { exportToCSV } from 'follow-table';
// Export data to CSV
exportToCSV(
data, // Data array to export
columns, // Columns to include
'filename.csv', // Optional filename
{ // Optional configuration
delimiter: ',',
includeHeaders: true,
dateFormat: 'short',
processCell: (value, column) => value
}
);
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
MIT
FAQs
A flexible and feature-rich React table component
We found that follow-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
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.