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

@tanstack/table-core

Package Overview
Dependencies
Maintainers
1
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/table-core

Hooks for building lightweight, fast and extendable datagrids for React

  • 8.0.0-alpha.71
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9M
decreased by-18.37%
Maintainers
1
Weekly downloads
 
Created

What is @tanstack/table-core?

The @tanstack/table-core npm package is a headless utility for building powerful tables and datagrid experiences. It provides the core logic needed to manage the state and features of a table without enforcing any rendering or styling, allowing developers to build fully customized tables.

What are @tanstack/table-core's main functionalities?

Column Ordering

This feature allows users to define the order of columns in their table. The code sample demonstrates how to use the useTable hook to create a table instance and render the headers based on the defined column order.

{"useTable": ("hooks, columns, data") => {"const instance = useTable({"columns, data"});"return instance.getHeaderGroups().map(headerGroup => headerGroup.headers.map(column => column.render('Header')));"}}

Row Selection

This feature enables row selection within a table. The code sample shows how to use the useRow hook to get the props necessary for toggling row selection and how to apply them to a row component.

{"useTable": ("hooks, columns, data") => {"const {"getToggleRowSelectedProps"} = useRow();"return data.map(row => {"const rowProps = row.getToggleRowSelectedProps();"return <div {...rowProps}>{row.values.name}</div>;"});"}}

Sorting

This feature allows users to sort data in the table by one or more columns. The code sample illustrates how to initialize a table with sorting on the 'name' column and how to get the props needed to toggle sorting on a header component.

{"useTable": ("hooks, columns, data") => {"const {"headers"} = useTable({"columns, data, initialState: {"sortBy: [{"id": 'name', "desc": false}]"}});"return headers.map(column => column.getSortByToggleProps());"}}

Other packages similar to @tanstack/table-core

Keywords

FAQs

Package last updated on 11 May 2022

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