Skip to main content

List

List is a performant themed wrapper around React Native's FlatList. ListItem provides a standardized row layout with title, description, and accessory slots.

Import​

import { List, ListItem } from '@ui-kitten/components';

Basic Usage​

import React from 'react';
import { Layout, List, ListItem, Icon } from '@ui-kitten/components';

const data = [
{ title: 'Item 1', description: 'Description for item 1' },
{ title: 'Item 2', description: 'Description for item 2' },
{ title: 'Item 3', description: 'Description for item 3' },
];

const renderItem = ({ item }) => (
<ListItem
title={item.title}
description={item.description}
accessoryLeft={(props) => <Icon {...props} name="person" />}
accessoryRight={(props) => <Icon {...props} name="arrow-ios-forward" />}
/>
);

const ListExample = () => (
<Layout style={{ flex: 1 }}>
<List data={data} renderItem={renderItem} />
</Layout>
);

Props​

List​

PropertyTypeDefaultDescription
appearance'default''default'Appearance defined in the Eva mapping.

List accepts all React Native FlatList props, and exposes scrollToEnd(), scrollToIndex() and scrollToOffset() through a ref typed as ListRef.

ListItem​

PropertyTypeDefaultDescription
titlestring | number | (props) => ReactElementundefinedPrimary text content of the list item.
descriptionstring | number | (props) => ReactElementundefinedSecondary text content displayed below the title.
accessoryLeft(props) => ReactElementundefinedRender function for the left accessory (e.g., icon or avatar).
accessoryRight(props: ViewProps) => ReactElementundefinedRender function for the right accessory. Unlike accessoryLeft, it receives ViewProps, so it can hold any view — a button, a toggle.
childrenReactNodeundefinedCustom content replacing the default layout. When provided, title and the accessories are ignored.
appearance'default''default'Appearance defined in the Eva mapping.

ListItem also accepts all standard React Native TouchableOpacity props, including onPress and disabled.

Storybook​

Live examples coming soon via Storybook.