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

@kirikirikil/table-kit

v0.0.8

Published

Svelte 5 + Tailwind v4 data-table components: resizable columns with per-table persisted widths, sortable headers, a virtualized body, and an optional sticky actions column.

Readme

@kirikirikil/table-kit

Svelte 5 + Tailwind v4 data-table components: resizable columns with per-table persisted widths, sortable headers, a virtualized body, and an optional sticky actions column.

Install

npm install @kirikirikil/table-kit

Peer dependencies: svelte ^5, @lucide/svelte ^0.561.

Tailwind setup

The components style themselves with Tailwind v4 utility classes against shadcn-style CSS variable tokens (--background, --muted, --border, --ring, --foreground, …). Your project needs those tokens mapped (Tailwind v4 @theme inline + --color-*), as in a standard shadcn-svelte setup.

Tailwind v4's automatic content detection skips node_modules, so if the package's utilities aren't generated, add an explicit source:

@import "tailwindcss";
@source "../../node_modules/@kirikirikil/table-kit/dist";

(In a pnpm workspace you can point at the package src instead.)

Usage

<script lang="ts">
	import {
		Table, TableHeader, TableRow, TableHead, TableHeadSortable,
		TableBody, TableCell, sortTable
	} from '@kirikirikil/table-kit';

	let sortKey = $state<string | null>(null);
	let direction = $state<'asc' | 'desc'>('asc');
	const rows = $derived(sortKey ? sortTable(data, sortKey, direction) : data);

	function toggleSort(key: string) {
		if (sortKey === key) direction = direction === 'asc' ? 'desc' : 'asc';
		else { sortKey = key; direction = 'asc'; }
	}
</script>

<Table tableId="products" columnKeys={['name', 'sku', 'price', '_actions']}>
	<TableHeader>
		<TableRow>
			<TableHeadSortable sortKey="name" currentSort={sortKey} direction={direction} onSort={toggleSort}>Name</TableHeadSortable>
			<TableHeadSortable sortKey="sku" currentSort={sortKey} direction={direction} onSort={toggleSort}>SKU</TableHeadSortable>
			<TableHeadSortable sortKey="price" currentSort={sortKey} direction={direction} onSort={toggleSort}>Price</TableHeadSortable>
			<TableHead aria-hidden="true" />
			<TableHead columnKey="_actions">Actions</TableHead>
		</TableRow>
	</TableHeader>
	<TableBody>
		{#each rows as r (r.sku)}
			<TableRow>
				<TableCell>{r.name}</TableCell>
				<TableCell>{r.sku}</TableCell>
				<TableCell>{r.price}</TableCell>
				<TableCell aria-hidden="true" />
				<TableCell>
					<button class="text-primary" onclick={() => edit(r)}>Edit</button>
				</TableCell>
			</TableRow>
		{/each}
	</TableBody>
</Table>

Sticky actions column

With a _actions last columnKey, keep the actions <th>/<td> the row's last child by rendering one empty filler cell (<TableCell aria-hidden="true" />, and a matching empty <TableHead aria-hidden="true" /> in the header) immediately before it. This keeps position: sticky; right: 0 working while the actions column stays flush right. Tables without an actions column need no filler cell.

API

| Component | Props | |---|---| | Table | tableId?, columnKeys?, defaultWidths?, actionsWidth?, maxHeight?, containerRef? | | TableHeadSortable | sortKey, currentSort, direction, onSort (renders a resize handle inside a resizable Table) | | VirtualTableBody | items, rowHeight? (default 41), overscan? (default 5), scrollContainer, row snippet (item, index) | | Table / TableHeader / TableRow / TableHead / TableCell / TableBody | also exported as Root / Header / Row / Head / Cell / Body | | helpers | sortTable(data, key, dir), sortTableBy(data, getValue, dir), cn |

Resizable columns clamp to 60–500 px and persist per table under localStorage key table-columns-<tableId>; leftover container space is distributed proportionally across them so the table fills its width. The sticky actions column auto-sizes to its content (max scrollWidth of the actions cells, clamped 60–500 px, re-measured on content changes); pass actionsWidth to override it explicitly.

License

MIT