Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-table

Package Overview
Dependencies
Maintainers
9
Versions
440
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-table

table ui component for react

  • 7.40.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5M
increased by5.25%
Maintainers
9
Weekly downloads
 
Created

What is rc-table?

The rc-table npm package is a React component for rendering tables. It provides a range of features for creating and managing tables in a React application, including customizable columns, sorting, pagination, and more.

What are rc-table's main functionalities?

Customizable columns

Define the structure of the table by specifying columns with titles, data indexes, and keys.

const columns = [
  { title: 'Name', dataIndex: 'name', key: 'name' },
  { title: 'Age', dataIndex: 'age', key: 'age' },
  { title: 'Address', dataIndex: 'address', key: 'address' }
];

<Table columns={columns} dataSource={data} />

Pagination

Easily paginate your table data by providing a pagination configuration object.

<Table columns={columns} dataSource={data} pagination={{ pageSize: 50 }} />

Sorting

Enable sorting on columns by providing a sorter function.

const columns = [
  { title: 'Name', dataIndex: 'name', key: 'name', sorter: (a, b) => a.name.length - b.name.length },
  { title: 'Age', dataIndex: 'age', key: 'age', sorter: (a, b) => a.age - b.age }
];

<Table columns={columns} dataSource={data} />

Selection

Allow row selection and handle selected rows with a callback function.

const rowSelection = {
  onChange: (selectedRowKeys, selectedRows) => {
    console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
  }
};

<Table rowSelection={rowSelection} columns={columns} dataSource={data} />

Expandable Rows

Create expandable rows to show additional information about a row.

const expandedRowRender = record => <p>{record.description}</p>;

<Table columns={columns} expandedRowRender={expandedRowRender} dataSource={data} />

Other packages similar to rc-table

Keywords

FAQs

Package last updated on 05 Feb 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc