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

@spark-web/data-table

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spark-web/data-table

--- title: DataTable storybookPath: data-display-data-table isExperimentalPackage: true ---

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

title: DataTable storybookPath: data-display-data-table isExperimentalPackage: true

The DataTable component presents a list of data in table form.

It uses @tanstack/react-table as a dependency to implement data selection and filtering capabilities. As such, certain table options are available as DataTable props. For example, the items and columns prop are required options.

Currently supported features from @tanstack/react-table are the following:

  1. Row selection
  2. Multi-row selection
  3. Column visibility

However, certain defaults have been set for the component:

  1. enableHiding is enabled by default;
  2. enableMultiRowSelection is disabled by default, meaning row selection defaults to single-row;
  3. enableRowSelection is automatically enabled when a callback value is passed in onRowSelectionChange.
  4. The data property in React Table options is renamed to items to align with the rest of Spark Web's usage of data as a data attribute.

Example

<DataTable
  items={[
    {
      id: 1,
      name: 'Ken Adams',
      category: 'Solar System',
      amount: 3500,
    },
  ]}
  columns={[
    {
      id: 'id',
      accessorKey: 'id',
      header: 'ID',
      cell: info => <Text size="small">{info.renderValue()}</Text>,
    },
    {
      id: 'name',
      accessorKey: 'name',
      header: 'Name',
      cell: info => <Text size="small">{info.renderValue()}</Text>,
    },
    {
      id: 'category',
      accessorKey: 'category',
      header: 'Category',
      cell: info => <Text size="small">{info.renderValue()}</Text>,
    },
    {
      id: 'amount',
      accessorKey: 'amount',
      header: 'Amount',
      cell: info => <Text size="small">{info.renderValue()}</Text>,
    },
  ]}
/>

Props

DataTable

FAQs

Package last updated on 17 Apr 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