npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tcn/ui-table

v2.1.2

Published

Blackcat UI Table

Readme

Table

This repo contains classes and components used for implementing UI tables.

Architectural Overview

This table contrasts with our past efforts in how we separate the business of data management from data rendering, and this approach has greatly simplified both the implementation and usage of the table.

All responsibilities relating to display (including localization and formatting) are handled here in the table itself, where we have access to our I18n and theme contexts.

Data handling is confined to the DataSource interface (discussed in more detail below).

We have thus eliminated all of the entanglement between presentation and data handling.

Components

This package provides several components that can be used together or independently:

  • Table: The main table component that renders the data
  • TableColumn: Configures how each column is displayed
  • TableSearch: Runs a global search on the given data source
  • TablePager: Pagination controls for the data source

The components are designed to work independently from each other, but may consume a common DataSource, allowing you to:

  • Use them together for a complete table experience
  • Implement your own header/footer components
  • Customize the layout and styling

In other words, if you pass the Table and TablePager the same DataStore instance, the paging controls in the footer will affect the Table.

Table

The core component that renders the actual table (as a semantic HTML <table> element). It handles:

  • Column configuration
  • Data rendering
  • Sorting
  • Sticky columns
  • Row highlighting

Data Source

The Table components (except the TableColumn) require a DataSource which manages:

  • Data fetching and updates
  • Sorting
  • Filtering
  • Pagination

The DataSource interface and implementations are found in a separate ResourceStore module.

Available Data Sources

  1. StaticDataSource: For working with static data
  2. AIPDataSource: For working with AIP-compliant REST resources

Column Configuration

The Table is configured with TableColumn components that describe:

  • Column position
  • Header content
  • Footer content
  • Sorting behavior
  • Cell rendering
  • Sticky positioning
  • Width

Basic Column Example

const s = useStringTranslation();

<Table dataSource={personSource}>
  <TableColumn
    heading={s("Name")}
    fieldName="name"
  /> 
</Table>

Column Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | heading | ReactNode | Yes | Content to display in the column header | | footer | ReactNode | No | Content to display in the column footer | | fieldName | string | No* | Name of the field in the data source | | canSort | boolean | No | Whether the column can be sorted | | render | (item: T) => ReactNode | No | Custom render function for cell content | | sticky | "start" \| "end" | No | Makes the column stick to the start or end | | width | number | No | Column width in pixels |

* Required if canSort is true

Custom Cell Rendering

You can customize how cells are rendered using the render prop:

const d = useDateTranslation();
const s = useStringTranslation();

<Table dataSource={personSource}>
  <TableColumn
    heading={s("Birthdate")}
    fieldName="birthdate"
    render={(item) => d(item.birthdate)}
  />
</Table>

Action Columns

Columns that don't represent data (like action buttons):

<Table dataSource={personSource}>
  <TableColumn
    heading={s("Actions")}
    render={(item) => (
      <Button onClick={() => myDomain.edit(item)}>
        {s("Edit")}
      </Button>
    )}
    sticky="end"
  />
</Table>

Styling

The table components use CSS modules for styling. You can:

  • Override default styles using CSS modules
  • Use the provided CSS variables for consistent theming
  • Add custom classes to individual components