Tally UI
Primitives

List

A performant virtualized list for rendering large datasets.

Import

import { List } from '@tallyui/primitives';

Usage

<List.Root
  data={items}
  renderItem={({ item }) => (
    <List.Item>
      <Text>{item.name}</Text>
    </List.Item>
  )}
  estimatedItemSize={60}
  keyExtractor={(item) => item.id}
/>

Components

List.Root

A virtualized flat list built on React Native's FlatList.

PropTypeDefaultDescription
dataT[]requiredThe array of items to render
renderItem(info: { item: T; index: number }) => ReactElementrequiredFunction that renders each item
estimatedItemSizenumberEstimated height of each item for virtualization
keyExtractor(item: T, index: number) => stringExtracts a unique key for each item

Plus all React Native FlatListProps (except renderItem, which is typed more strictly).

List.Item

A container for a single list row.

PropTypeDefaultDescription
childrenReactNodeContent of the list item

Plus all React Native ViewProps.

Accessibility

  • Inherits FlatList accessibility behavior
  • Each item should contain accessible content or have accessibilityLabel set

On this page