sveltelean Table
Version v0.18.0

At a glance

Search, selection, column controls and paging are props. Sort a column, select rows, hide a column.

Columns
Amara Okafor
Active
Engineering
Europe
$4,501
2026-01-07
Jonas Lindqvist
Active
Design
Americas
$12,420
2026-06-18
Mei Tanaka
Away
Operations
Asia
$20,339
2026-02-01
Rafael Duarte
Invited
Growth
Europe
$28,258
2026-07-12
Selin Aydın
Active
Engineering
Americas
$36,177
2026-03-23
Noah Brenner
Active
Design
Asia
$44,096
2026-08-06
Page 1 of 6 · 36 rows
members.svelte
<script lang="ts">
	import '@svelte-lean/table/style.css';
	import { DataTable, type Column } from '@svelte-lean/table';

	type Member = { id: number; name: string; team: string; revenue: number };
	let { members }: { members: Member[] } = $props();

	const columns: Column<Member>[] = [
		{ id: 'name', header: 'Name' },
		{ id: 'team', header: 'Team' },
		{ id: 'revenue', header: 'Revenue', align: 'end' }
	];
</script>

<DataTable
	data={members}
	{columns}
	getRowId={(row) => row.id}
	label="Members"
	searchable
	selection="multiple"
	columnControls
	state={{ pageSize: 6 }}
/>
  • The output is a <table> with caption, scope and aria-sort; it renders on the server.
  • State is one plain, serializable object you can control from outside; every string is a message.
  • A cell is a component only when you pass a snippet. The engine underneath, createTable(), and the Svelte-free @svelte-lean/table/core are documented under Engine.

Capability levels

One component; a table pays only for the levels it uses.

LevelAddsHowStatus
TableA native <table> with caption, colgroup, thead, tbody, tfoot, scope and aria-sort; snippets for cells; SSR.<DataTable /> with the three required propsshipped
DataTableSorting, search and filters, selection, pagination, expansion and tree rows, pinning, resizing, visibility and order, sticky header, states, messages.Props; state in one objectshipped
Virtual TableA windowed body for very large row counts.A future opt-in (@svelte-lean/virtual), extracted only when a reusable need is provednot shipped
Data GridCell focus and arrow-key navigation, inline editing, range selection, copy and paste, grouping and pivot, persisted state, server data sources.Props that switch the keyboard model on, plus separate entry pointsshipped, rows not virtualized

Rows are not virtualized. A project that needs virtual rows today needs another package.

What a build ships

The table-basic fixture (DataTable and its stylesheet, Vite 7.3.6, Svelte 5.57.1, production build) ships 20841 B brotli of Svelte Lean code, plus Svelte's runtime (15980 B brotli). Its module graph is asserted to exclude grouping.js, pivot.js, clipboard.js, export.js, server.js, state.js (55 checks passed).

Entry points

EntryFileContainsgzipbrotliBudget (gzip)
rendererdist/index.jsthe root entry: <DataTable />, createTable(), helpers, messages25080 B22014 B25200 B
headlessdist/core.jsthe ./core entry: pure row model functions, no Svelte2665 B2440 B2700 B
enginedist/table.svelte.jscreateTable() on its own (runes)3538 B3244 B3600 B
groupingdist/grouping.jsgroupBy(), summarize(), aggregate()2149 B1962 B2400 B
pivotdist/pivot.jspivot()526 B470 B600 B
editingdist/editing.jsapplyEdit(), setValue(), parseEdit(), createHistory()707 B617 B800 B
csvdist/export.jstoCsv(), parseDelimited(), downloadText()741 B646 B850 B
clipboarddist/clipboard.jscopyRange(), pasteRange(), rangeBounds()895 B803 B1000 B
serverdist/server.jscreateDataSource()369 B310 B425 B
statedist/state.jsserializeState(), restoreState()796 B711 B900 B
stylesdist/style.cssstyle.css9086 B7896 B9100 B

Each entry bundled independently with esbuild (bundle + minify, ESM); shared code is counted per entry here and de-duplicated by consumer bundlers. Svelte peer runtime excluded. gzip level 9 / brotli quality 11 (node:zlib). Budgets are gzip. Each entry is measured on its own; a bundler de-duplicates shared code, so entries do not add up.

Timings

Medians of the playground benchmark, every row in the document.

SubjectMedianp95Method
Mount, one thousand rows287.3 ms303 mscomponent init to the second animation frame after onMount, client render of the whole table (ssr=false); median of 5 loads
Sort by revenue, one thousand rows156.1 ms161 msheader button click (ascending by revenue) to the second animation frame; median of 5
Mount, ten thousand rows3088.2 ms3139.1 mscomponent init to the second animation frame after onMount, client render of the whole table (ssr=false); median of 5 loads
Sort by revenue, ten thousand rows1599.5 ms1618.5 msheader button click (ascending by revenue) to the second animation frame; median of 5

chromium 153.0.8010.12, AMD EPYC 9555P 64-Core Processor, linux 6.12.107+deb13-cloud-amd64, Node v22.23.3, production build, run 2026-10-05. Methodology

Specimens

Every specimen is a live DataTable with its source, on the page of its feature.