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 🙏

© 2026 – Pkg Stats / Ryan Hefner

bastilian-tabletools

v2.18.1

Published

A collection of hooks and components to build tables based on the PatternFly (v4) `Table` component and the Red Hat Insights `PrimaryToolbar` component.

Readme

Table Tools

The "Table Tools" are a collection of hooks and components to build tables based on the PatternFly (v4) Table component and the Red Hat Insights PrimaryToolbar component.

It provides implementations and state management for several features and provides a context to access the state to request/provide data to show on the table.

Supported PrimaryToolbar features

  • pagination - {@link Main.usePagination usePagination}
  • exportConfig - {@link Main.useExport useExport}
  • bulkSelect - {@link Main.useBulkSelect useBulkSelect}
  • column management - {@link Main.useColumnManager useColumnManager}
  • filterConfig & activeFiltersConfig - {@link Main.useFilterConfig useFilterConfig}
  • toolbar actions

Supported Table feature

  • sorting columns - {@link Main.useTableSort useTableSort}
  • selectable rows - {@link Main.useBulkSelect useBulkSelect}
  • radio selectable rows - {@link Main.useRadioSelect useRadioSelect}
  • expandable rows - {@link Main.useTableView useTableView}
  • TreeTable - {@link Main.useTableView useTableView}
  • EmptyState - {@link Main.useTableView useTableView}

Install

$ npm install --save bastilian-tabletools

Basic usage

The tabletools offer three ways of building and filling a table, via an async function that returns an array of paginated items, via an useQuery like hook that provides the table with an array of paginated items or by using the StaticTableToolsTable with an "static" array of all items unpaginated.

Using an async function

An async function can be provided as the items prop to retrieve items to show in the table. The function should return an array with two items, the first being the array of items to show and the second being the total amount of items available to show in the table.

import { TableToolsTable } from 'bastilian-tabletools';

const BasicExample = () => {
  const fetchItems = async () => {
    const response = await fetch('/api')
    const json = await response.json();

    return [json.data, json.meta.total]
  }

  const columns = [
    {
      title: 'Title',
      key: 'title'
    },
  ];

  return (
    <TableToolsTable items={fetchItems} columns={columns} />
  );
}

export default BasicExample;

Using a useQuery (like) hook

To use the TableToolsTable component with an useQuery like hook, it needs to be passed a loading, items, total and optionally an error prop. The loading prop should be the loading state of the hook. The items should be the fetched result(s) in an array, with the total being the overall amount of items/results available.

import { TableToolsTable } from 'bastilian-tabletools';

const BasicQueryExample = () => {
  const {
    loading,
    result: { data, meta: { total } = {} } = {},
    error,
  } = useExampleDataQuery({ endpoint: '/api' });

  const columns = [
    {
      title: 'Title',
      key: 'title',
    },
  ];

  return (
    <TableToolsTable
      loading={loading}
      items={data}
      error={error}
      total={total}
      columns={columns}
    />
  );
};

export default BasicQueryExample;

Using the StaticTableToolsTable

In cases where it is not possible to fetch paginated results from an API, or it is unnecessary to only fetch paginated results, the StaticTableToolsTable can be used.

It can be passed an array of all available items/results and provides sorting and filtering of arrays out of the box.

import { StaticTableToolsTable } from 'bastilian-tabletools';

const BasicStaticExample = () => {
  const arrayOfItems = itemsFactory(4096);

  const columns = [
    {
      title: 'Title',
      key: 'title',
    },
    {
      title: 'Artist',
    },
  ];

  return (
    <StaticTableToolsTable
      items={arrayOfItems}
      columns={columns}
    />
  );
};

export default BasicStaticExample;

For more advance use please see the rest of the documentation at bastilian.github.io/tabletools/