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

List accepts all React Native FlatList props.

ListItem

PropertyTypeDefaultDescription
titleReactText | (props) => ReactElementundefinedPrimary text content of the list item.
descriptionReactText | (props) => ReactElementundefinedSecondary text content displayed below the title.
accessoryLeft(props) => ReactElementundefinedRender function for the left accessory (e.g., icon or avatar).
accessoryRight(props) => ReactElementundefinedRender function for the right accessory (e.g., icon or button).
onPress() => voidundefinedCalled when the list item is pressed.
childrenReactNodeundefinedCustom content replacing the default layout.

Storybook

Live examples coming soon via Storybook.