Reference version

ListItem

A Jetpack Compose ListItem component for displaying structured list entries.

Android
Bundled version:
~55.0.0

A list item component that follows Material Design 3 guidelines for structured list entries with headline, supporting text, and leading/trailing slots. See the official Jetpack Compose documentation for more information.

Installation

Terminal
npx expo install @expo/ui

If you are installing this in an existing React Native app, make sure to install expo in your project.

Usage

Basic list item

BasicListItem.tsx
import { Host, ListItem } from '@expo/ui/jetpack-compose'; export default function BasicListItem() { return ( <Host matchContents> <ListItem headline="Settings" /> </Host> ); }

With supporting text and overline

Use the supportingText prop to add a secondary line and overlineText for a category label above the headline.

ListItemWithText.tsx
import { Host, ListItem } from '@expo/ui/jetpack-compose'; export default function ListItemWithText() { return ( <Host matchContents> <ListItem overlineText="ACCOUNT" headline="Profile" supportingText="Manage your account settings and preferences" /> </Host> ); }

With leading and trailing slots

Use ListItem.Leading and ListItem.Trailing sub-components to add content to the start and end of the list item.

ListItemWithSlots.tsx
import { Host, ListItem, Icon } from '@expo/ui/jetpack-compose'; export default function ListItemWithSlots() { return ( <Host matchContents> <ListItem headline="Notifications" supportingText="Manage notification preferences"> <ListItem.Leading> <Icon source={require('./assets/notifications.xml')} contentDescription="Notifications" /> </ListItem.Leading> <ListItem.Trailing> <Icon source={require('./assets/chevron_forward.xml')} contentDescription="Navigate" /> </ListItem.Trailing> </ListItem> </Host> ); }

API

import { ListItem } from '@expo/ui/jetpack-compose';

Components

ListItem

Android

Type: React.Element<ListItemProps>

A list item component following Material 3 design guidelines.

ListItemProps

children

Android
Optional • Type: React.ReactNode

Children containing Leading and Trailing slots.

color

Android
Optional • Type: ColorValue

The background color of the list item.

colors

Android
Optional • Type: ListItemColors

Colors for list item's core elements.

headline

Android
Type: string

The main text content of the list item.

modifiers

Android
Optional • Type: ExpoModifier[]

Modifiers for the component.

onPress

Android
Optional • Type: () => void

Callback that is called when the list item is pressed.

overlineText

Android
Optional • Type: string

Optional overline text displayed above the headline.

supportingText

Android
Optional • Type: string

Optional supporting text displayed below the headline.

ListItemLeading

Android

Type: React.Element<LeadingProps>

Leading content slot for ListItem.

ListItemSupportingContent

Android

Type: React.Element<SupportingContentProps>

Custom supporting content slot for ListItem. When provided, this takes precedence over the supportingText prop.

ListItemTrailing

Android

Type: React.Element<TrailingProps>

Trailing content slot for ListItem.

Types

ListItemColors

Android

Colors for list item's core elements.

PropertyTypeDescription
containerColor(optional)ColorValue
-
headlineColor(optional)ColorValue
-
leadingIconColor(optional)ColorValue
-
overlineColor(optional)ColorValue
-
supportingColor(optional)ColorValue
-
trailingIconColor(optional)ColorValue
-