Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

VirtualList

Search a large directory without mounting every visible record at once.

Preview

Live preview

Changes apply to this preview only.

Team directory

2,000 people · search re-renders the window, not the list

2000 matching member(s)

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Audit log

10,000 events at a fixed 56 px row height with three rows of overscan. The spacer keeps the real scrollbar length.

Open preview

50,000 log lines

A 50,000 log lines composition using VirtualList.

Open preview

Compact rows

A compact rows composition using VirtualList.

Open preview

Usage

Keep item identities and estimated dimensions stable; virtualization changes which rows exist in the DOM.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluVirtualListItemsProps

Type source
PimoluVirtualListItemsProps public API
NameTypeDefaultDescription
itemsRequiredreadonly T[]—Data source. Its length defines the row count.
itemCountundefined—Public Pimolu prop; see the source declaration for details.
renderItemRequired(item: T, index: number) => ReactNode—Renders one item.
getKey((item: T, index: number) => Key) | undefined—Stable React key for a row. Falls back to the index.
itemHeightRequirednumber—Fixed height of every row, in pixels.
heightRequirednumber—Height of the scroll viewport, in pixels.
overscannumber | undefined3Extra rows rendered above and below the viewport. Defaults to 3.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
itemsRequired

readonly T[]

No default extracted.

Data source. Its length defines the row count.

itemCount

undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

renderItemRequired

(item: T, index: number) => ReactNode

No default extracted.

Renders one item.

getKey

((item: T, index: number) => Key) | undefined

No default extracted.

Stable React key for a row. Falls back to the index.

itemHeightRequired

number

No default extracted.

Fixed height of every row, in pixels.

heightRequired

number

No default extracted.

Height of the scroll viewport, in pixels.

overscan

number | undefined

Default: 3

Extra rows rendered above and below the viewport. Defaults to 3.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluVirtualListCountProps

Type source
PimoluVirtualListCountProps public API
NameTypeDefaultDescription
itemCountRequirednumber—Row count when there is no item array.
itemsundefined—Public Pimolu prop; see the source declaration for details.
renderItemRequired(index: number) => ReactNode—Renders one row from its index.
getKey((index: number) => Key) | undefined—Stable React key for a row. Falls back to the index.
itemHeightRequirednumber—Fixed height of every row, in pixels.
heightRequirednumber—Height of the scroll viewport, in pixels.
overscannumber | undefined3Extra rows rendered above and below the viewport. Defaults to 3.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
itemCountRequired

number

No default extracted.

Row count when there is no item array.

items

undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

renderItemRequired

(index: number) => ReactNode

No default extracted.

Renders one row from its index.

getKey

((index: number) => Key) | undefined

No default extracted.

Stable React key for a row. Falls back to the index.

itemHeightRequired

number

No default extracted.

Fixed height of every row, in pixels.

heightRequired

number

No default extracted.

Height of the scroll viewport, in pixels.

overscan

number | undefined

Default: 3

Extra rows rendered above and below the viewport. Defaults to 3.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluVirtualListProps

Type source
PimoluVirtualListProps public API
NameTypeDefaultDescription
itemCountnumber | undefined—Row count when there is no item array.
itemsreadonly T[] | undefined—Data source. Its length defines the row count.
renderItemRequired((index: number) => ReactNode) | ((item: T, index: number) => ReactNode)—Renders one row from its index. Renders one item.
getKey((index: number) => Key) | ((item: T, index: number) => Key) | undefined—Stable React key for a row. Falls back to the index.
itemHeightRequirednumber—Fixed height of every row, in pixels.
heightRequirednumber—Height of the scroll viewport, in pixels.
overscannumber | undefined3Extra rows rendered above and below the viewport. Defaults to 3.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
itemCount

number | undefined

No default extracted.

Row count when there is no item array.

items

readonly T[] | undefined

No default extracted.

Data source. Its length defines the row count.

renderItemRequired

((index: number) => ReactNode) | ((item: T, index: number) => ReactNode)

No default extracted.

Renders one row from its index. Renders one item.

getKey

((index: number) => Key) | ((item: T, index: number) => Key) | undefined

No default extracted.

Stable React key for a row. Falls back to the index.

itemHeightRequired

number

No default extracted.

Fixed height of every row, in pixels.

heightRequired

number

No default extracted.

Height of the scroll viewport, in pixels.

overscan

number | undefined

Default: 3

Extra rows rendered above and below the viewport. Defaults to 3.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Verify focus does not disappear on scroll and provide search or another route to offscreen items.
Read the accessibility guide →