Data

Windowed table.

A bounded view of larger datasets, with grouping and steady keyboard navigation.

LIVE PREVIEWTry it. It works.

Install the source

Terminal
npx shadcn@latest add https://ui.bld8.dev/r/windowed-table.json

Registry setup · Examples · API and behavior · Open the playground

COMPLETE EXAMPLES

Use it in context.

Each example includes its imports, data and state. The preview runs that same source. Include the stylesheet once in your application.

A window over complete local rows

The caller supplies the complete dataset; keyboard selection and a separate detail readout remain explicit.

Loads this example when you need it.

Keyboard

  • Arrow keys move row focus; Home/End reach endpoints.
  • Space selects a row; Enter opens its local details.

States covered

  • Windowed rows
  • Selected rows
  • Detail readout

Install this complete example and its component dependencies.

Terminal
npx shadcn@latest add https://ui.bld8.dev/r/example-basic-windowed-table.json
Complete source
React / TypeScript
/*!
MIT License

Copyright (c) 2026 Jaison

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
'use client';
import {useState} from 'react';
import {WindowedTable,type Column} from '@bld8/ui';
import '@bld8/ui/styles.css';
type Row={id:string;title:string};
const rows:Row[]=Array.from({length:120},(_,index)=>({id:'EX-'+(index+1),title:'Example issue '+(index+1)}));
const columns:Column<Row>[]=[{key:'id',header:'ID',cell:row=>row.id,width:120},{key:'title',header:'Title',cell:row=>row.title,flex:1}];
export default function WindowExample(){const [selected,setSelected]=useState<string[]>([]),[detail,setDetail]=useState('');return <div><WindowedTable caption="Example local issues" rows={rows} columns={columns} rowKey={row=>row.id} rowLabel={row=>row.title} height={320} selectable selectedKeys={selected} onSelectedKeysChange={setSelected} onRowAction={row=>setDetail(row.title)}/><p role="status">{selected.length} selected. {detail}</p></div>;}

Quick reference

React / TypeScript
<WindowedTable caption="Issues" rows={rows} columns={columns}
  rowKey={row=>row.id} rowLabel={row=>row.id} height={480}
  grouping={{key:row=>row.status,label:key=>key}} selectable
  selectedKeys={selected} onSelectedKeysChange={setSelected}
  onRowAction={openIssueDetails} />

In the workspace or ZIP starter, import components from @bld8/ui and include @bld8/ui/styles.css once. Registry installations use your local bld8/ source path. Wrap overlays in UIProvider.

API & behaviour

A native table over complete supplied rows, limited to 20,000 records and 40,000 logical entries including group headings. Columns reuse Column<T>; cells must be single-line display content, with detail/edit forms outside the window. Fixed row height, overscan and an explicitly bounded viewport keep mounted rows small. Arrow keys, Home/End and Page Up/Down move row focus; Space selects, Enter opens details. Focused rows stay mounted across scrolling. Group collapse retains selection and returns child focus to its disclosure. Counts and indices include logical group rows but exclude spacer rows. Header/group selection covers supplied records, not only rendered rows. Host filtering/sorting and service loading remain explicit; sort/onSortChange only report the chosen order. Provide paged reading over the same records for complete standard table access. Native browser scroll stays immediate; shared easing applies to feedback and disclosures.

WindowedTable

WindowedTable public properties
PropTypeDefault
captionRequiredstring—
columnsRequiredreadonly Column<T>[]

Single-line display cells only. Keep forms and editable drafts outside this table.

—
rowKeyRequired(row: T) => string—
rowsRequiredreadonly T[]

Complete, already filtered records. Up to 20,000 records; no service fetching.

—
collapsedGroupKeysreadonly string[] | undefined—
defaultCollapsedGroupKeysreadonly string[] | undefinedEMPTY_KEYS
defaultSelectedKeysreadonly string[] | undefinedEMPTY_KEYS
groupingTableGrouping<T> | undefined—
heightnumber | undefined

Viewport height in CSS pixels, clamped to 240–800.

480
onCollapsedGroupKeysChange((keys: string[]) => void) | undefined—
onRowAction((row: T) => void) | undefined

Open a detail view or editor owned outside the windowed rows.

—
onSelectedKeysChange((keys: string[]) => void) | undefined—
onSortChange((sort: TableQuery["sort"]) => void) | undefined—
overscannumber | undefined5
rowHeightnumber | undefined

Uniform record and group height, clamped to 44–96 CSS pixels.

56
rowLabel((row: T) => string) | undefinedrowKey
selectableboolean | undefinedfalse
selectedKeysreadonly string[] | undefined—
sortTableSort | null | undefined

The host applies sorting to rows; this component reports header intent.

null

Column

Column public properties
PropTypeDefault
cellRequired(row: T) => ReactNode—
headerRequiredstring—
keyRequiredstring—
align"center" | "start" | "end" | undefined—
exportValue((row: T) => string | number) | undefined—
flexnumber | undefined

Extra available width is assigned to flexible columns.

—
hideableboolean | undefined—
minWidthnumber | undefined—
pinned"start" | "end" | undefined—
resizableboolean | undefined—
sortValue((row: T) => string | number) | undefined—
widthnumber | undefined—

TableGrouping

TableGrouping public properties
PropTypeDefault
keyRequired(row: T) => string—
labelRequired(key: string) => string—

Tables come from the public TypeScript declarations. Related types and function parameters are shown alongside their component. A dash means no default is declared at the public function boundary.

Related controls

Notes to self

Test this component with real content, keyboard input and both themes. The example is a starting point; labels, error handling and behaviour still need to fit the application.