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

@urbicon-ui/table

v6.3.6

Published

Data table for Svelte 5 — sorting, filtering, grouping, selection, keyboard navigation, virtualization and live updates

Readme

@urbicon-ui/table

Feature-complete data table for Svelte 5 — zero runtime dependencies, part of the Urbicon UI monorepo.

Maturity: stable since v1.0.0 (2026-05-12). v2.0.0 (2026-05-15) refactored the Column API to separate accessor (value extraction) from id (state-targeting), eliminating the "[object Object]"-search trap; see CHANGELOG.md. All nine implementation phases are closed; 185 unit tests cover every concern.

Installation

This package ships inside the Urbicon UI monorepo. Install from repo root:

bun install

Peer dependencies: svelte (^5), @urbicon-ui/blocks, @urbicon-ui/i18n.

Capability Overview

| Area | Highlights | | ------------------- | --------------------------------------------------------------------------------------------------------------------------- | | Data pipeline | $derived-chain items → filteredItems → sortedItems → grouped → paginatedItems; all stages reactive | | Sorting & Filtering | Column sort (asc/desc/none tri-state), smart filter bar, column-level filters, search highlighting | | Selection | Single / multi, onSelectionChange, indeterminate header, keyboard toggle (Space) | | Keyboard | Roving tabindex, ARIA-Grid role, arrow keys, Home/End/PageUp/PageDown, Skip-Link | | Grouping | groupByKey, collapsible group headers, grouped summary rows | | Pagination | Built-in paginator, auto-disable on grouping, mobile-friendly controls | | Virtualization | computeVirtualItems for 10k+ rows (custom, zero deps); virtualHeight prop; falls back to normal rendering when inactive | | Column ordering | Pointer-event drag-and-drop + Shift+ArrowLeft/Right keyboard reorder via shared createDraggable action | | Column visibility | Header menu + persistence API | | Remote mode | mode: 'server' + queryFn (managed fetch with AbortSignal) or onQueryChange (manual), debounced, cancellation-safe | | Live updates | pushInsert/Update/Delete pending-buffer, LiveUpdateBanner, auto-apply on navigation | | Styling | unstyled, slotClasses, TableStyleContext — every subcomponent respects the 17-slot map | | Cells | LinkCell, NumberCell, DateCell, UserAvatar, StatusBadge, CustomCell, Fill-Cell | | i18n | Package-scoped namespace table.*, EN + DE |

Quick Start

<script lang="ts">
  import { Table, TableColumns } from '@urbicon-ui/table';

  let items = $state([
    { id: 1, name: 'Alice', role: 'Admin' },
    { id: 2, name: 'Bob', role: 'User' }
  ]);

  const columns = [
    TableColumns.text('name', 'Name', { sortable: true }),
    TableColumns.text('role', 'Role')
  ];
</script>

<Table {items} {columns} selectionMode="multi" onSelectionChange={(rows) => console.log(rows)} />

Server-mode with managed fetch

<Table
  mode="server"
  serverTotalItems={total}
  queryFn={async (query, { signal }) => {
    const res = await fetch(`/api/users?${new URLSearchParams(query)}`, { signal });
    return res.json(); // { items, totalItems }
  }}
  {columns}
/>

Live updates

<Table {items} {columns} enableLiveUpdates>
  {#snippet aboveTable({ ctx })}
    <button onclick={() => ctx.pushInsert({ id: crypto.randomUUID(), name: 'New' })}>
      + row
    </button>
  {/snippet}
</Table>

State Persistence

persistenceConfig={{ tableId: 'foo' }} is enough to make filters, search, group-by, summaries, sort, column visibility and column order survive a page reload. Every axis is on by default and stored under a tableId-scoped key in localStorage. Pagination is intentionally not persisted — page 1 on navigation is standard UX.

<Table {items} {columns} persistenceConfig={{ tableId: 'expenses' }} />

Disable individual axes (e.g. always start filter-free, but keep the column layout the user picked):

<Table
  {items}
  {columns}
  persistenceConfig={{
    tableId: 'expenses',
    persistFilters: false,
    persistSearch: false
  }}
/>

Storage keys are namespaced by tableId (urbicon_table_filters_expenses_v1, …); pick a stable, unique tableId per table — two tables sharing one id will overwrite each other.

storage: 'sessionStorage' limits persistence to the current tab (lost on tab close). The clearAllPersistentData and forceSavePersistentData methods on the table context let you reset or flush state imperatively.

Subcomponent Styling

Every structural subcomponent (EmptyState, ErrorState, LoadingState, GroupedRow, SummaryRow, MobileCard, SmartFilterBar) consumes TableStyleContext — pass slotClasses at the <Table> root and it reaches the leaves.

<Table
  {items}
  {columns}
  unstyled
  slotClasses={{
    container: 'rounded-2xl bg-surface-elevated',
    headerCell: 'text-text-tertiary uppercase tracking-wider text-xs',
    row: 'hover:bg-surface-hover'
  }}
/>

i18n

Namespace: table.*. Resolve typed keys via the context hook useTableI18n — call it during component init and alias the result tt:

<script>
  import { useTableI18n } from '@urbicon-ui/table';
  const tt = useTableI18n();
</script>

<span>{tt('data.loading')}</span>
<!-- "Loading data…" -->
<span>{tt('pagination.showing', { start: 1, end: 10, total: 100 })}</span>

Resolves against the request-scoped locale from <I18nProvider> (or the base locale en without one). Add a locale: register a new package via @urbicon-ui/i18n's createPackageI18n, or extend the existing bundles in src/lib/translations/.

Development

bun --filter='@urbicon-ui/table' run dev     # svelte-package watch
bun --filter='@urbicon-ui/table' run build   # svelte-package
bun --filter='@urbicon-ui/table' run check   # svelte-check
bunx --bun vitest run                        # unit tests (from package root)

Related