Gathering detailed insights and metrics for sticky-react-table
Gathering detailed insights and metrics for sticky-react-table
Gathering detailed insights and metrics for sticky-react-table
Gathering detailed insights and metrics for sticky-react-table
react-table-sticky
Sticky components for react-table v7
react-sticky-table
Dynamically sized fixed header and columns for tables
cm-react-sticky-table
A table to show data in an organized form, with interactive capabilities of sorting, searching, paginating etc and applied stickiness in columns, rows
@vies/react-table-sticky
Sticky components for react-table v7
npm install sticky-react-table
Typescript
Module System
Node Version
NPM Version
JavaScript (86.77%)
CSS (12.48%)
HTML (0.75%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
14 Stars
324 Commits
5 Forks
6 Watchers
3 Branches
5 Contributors
Updated on Jan 28, 2023
Latest Version
0.4.26
Package Id
sticky-react-table@0.4.26
Unpacked Size
158.82 kB
Size
28.66 kB
File Count
57
NPM Version
6.4.0
Node Version
10.5.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Many large-scale applications require the use of tables somewhere, if not everywhere. Many a times the requirements for these tables are quite complex and difficult to manage. Sticky React Table aims to solve all of these problems for React developers, with a host of features including customizable cells, rows, and headers, column switching, column filtering, sorting, virtualization, column resizing, etc. All of that, provided in a declarative manner, and built ground-up, especially for React!
The package is still under development. We are working actively to get this package to a stable release as soon as possible. Please do not use this package in any production application.
Installing Sticky React Table is as simple as using your favourite package manager (ex. yarn
or npm
).
For NPM:
npm install sticky-react-table
For Yarn:
yarn add sticky-react-table
The sticky-react-table
package exposes two major components: Table
and Column
.
Consider a sample data set:
1[ 2 { 3 "name": "John Doe", 4 "age": 24, 5 "location": "Chicago", 6 "occupation": "Research Analyst" 7 }, 8 { 9 "name": "Jane Delaney", 10 "age": 22, 11 "location": "London", 12 "occupation": "Software Developer" 13 }, 14 { 15 "name": "Nishant Singh", 16 "age": 28, 17 "location": "Mumbai", 18 "occupation": "Business Developer" 19 } 20]
The simplest implementation of the above data as an Sticky React Table would be like so:
1import React, { Component } from 'react'; 2import ReactDOM from 'react-dom'; 3import { Table, Column } from 'sticky-react-table'; 4 5import data from './data.json'; 6 7class MyTable extends Component { 8 render() { 9 return ( 10 <Table data={data}> 11 <Column title="Name" width={200} dataKey="name" /> 12 <Column title="Age" width={50} dataKey="age" /> 13 <Column title="Occupation" width={200} dataKey="occupation" /> 14 <Column title="Location" width={150} dataKey="location" /> 15 <Column title="Top Skill" width={150} dataKey="topSkill" /> 16 </Table> 17 ); 18 } 19} 20 21const rootElement = document.getElementById('root'); 22ReactDOM.render(<MyTable />, rootElement);
From here on, you can customize the cell, row or header renderers, add custom classes, style it however you need.
If you use SASS as a pre-processor, two default themes are provided: light and dark. To use the themes, simply import the relevant theme.
sticky-react-table/lib/themes/light.scss
sticky-react-table/lib/themes/dark.scss
Sticky React Table supports a host of properties which allow you to completely customize the look and feel of the table. You can find the properties supported by the two major components of the package.
Property | Type | Default | Description |
---|---|---|---|
children | Column | undefined | The Column component. It does not accept any other children. |
fixed | Number | undefined | The number of fixed columns in the table. |
rowSelection | Bool | true | This property determines whether checkbox column is rendered. |
idKey | String | id | A key used to uniquely identify data. |
rowClassName | String | undefined | Custom classes for a row. |
headerClassName | String | undefined | Custom classes for the header row. |
selectedRows | Array | undefined | An array of ids to make the table a controlled component. |
infiniteScrollTotalCount | Number | undefined | Total number of rows which can be loaded using infinite loader. |
infiniteScrollLoadMore | Function | undefined | Invoked when a new page is requested when using infinite loader. |
infiniteScrollThreshold | Number | 10 | The number of rows before the end of the table to trigger a call. |
infiniteScrollLoaderRowCount | Number | 5 | The number of additional rows to display at the bottom for loading. |
infiniteScrollPageSize | Number | 30 | A number of rows loaded with each portion. |
infiniteScrollCellRenderer | Node or Function | undefined | Custom content to display within cells of additional loader rows. |
Name | Description | Parameters |
---|---|---|
onSort | Pass a custom sorting functionality. | Array of column data |
onRowCheck | Handle checking of a row. | Id of the checked row or "all" if all rows are checked. |
checkboxRenderer | Custom renderer for checkbox column. | Cell Props |
rowRenderer | Custom row renderer | Row Props |
ref | Get ref of inner component. | Reference to inner component |
Property | Type | Default | Description |
---|---|---|---|
dataKey | String | undefined | The data key for the value to be rendered into the cell |
title | String | undefined | The title to be displayed in the header if no renderer is specified. |
width | Number | 0 | The absolute width of the column. |
className | Array or String | undefined | A custom class for the cell. |
alwaysVisible | Bool | false | Defines whether the column should always be visible. |
filterAlignment | String | left | Whether the filter should be aligned to the left or right of header cell. |
Name | Description | Parameters |
---|---|---|
cellRenderer | A custom cell renderer to modify the default rendering. | Cell Props |
headerRenderer | A custom header cell renderer to modify the default rendering. | Cell Props |
filterRenderer | A custom header filter renderer to add column filters. | Filter Props |
filterTrigger | A custom header filter trigger renderer for showing the column filters. | None |
The cell props allow you to access the data for the entire row, and some additional information about the cell. This particularly helps in customizing the cell, based on the information or the data for that row.
Every custom render function you use across the table, ex. headerRenderer
and cellRenderer
, get these props as the parameters of the renderer.
1propTypes = {
2 id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
3 rowData: PropTypes.object,
4 cellData: PropTypes.any,
5 isChecked: PropTypes.bool
6 isCheckbox: PropTypes.bool,
7 style: PropTypes.object,
8 title: PropTypes.string, // Only available in headerRenderer
9 isAllSelected: PropTypes.bool // Only available in headerRenderer
10}
The filter props allows you to access the data for the table and the dataKey of a column. This helps in creating a custom filters in any column, based on the data of the table.
1propTypes = {
2 data: PropTypes.array,
3 dataKey: PropTypes.string
4};
The row props allow you to access the data for the row, and some additional methods to help you render the defaults. Only the rowRenderer
function gets access to row props.
1propTypes = {
2 id: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
3 rowIndex: PropTypes.number,
4 rowData: PropTypes.object,
5 columns: PropTypes.array,
6 isChecked: PropTypes.bool,
7 renderColumns: PropTypes.func,
8 defaultRowRenderer: PropTypes.func
9}
headerRenderer
, always render an inline element if you have either sorting or column filters in the cell. Otherwise the alignment will break.Since we are still developing and this is a fairly large project, we would ❤️ contributions! We are looking for people who echo our sentiments and share the same idea about Sticky React Table.
Check out the CONTRIBUTING.md file for details.
For any issues or queries you might have about the table, please feel free to create one in the issues section.
We started developing Sticky React Table due to a lot of issues we faced while implementing tables in our application, with React. Leading up to 1.0.0
, we plan on supporting the following features:
In the future, we plan on implementing the following:
Features at no point will we build:
This project is under the MIT License. You can checkout the LICENSE file for info.
Copyright © 2018.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/26 approved changesets -- score normalized to 0
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
177 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More