ExpoStartup

ListItem

A versatile component for creating interactive list items.

ListItem

A flexible component for creating list items with leading and trailing elements, supporting text, icons, and avatars.

Import

import ListItem from '@/components/layout/ListItem';

Features

  • Support for leading elements (icon, avatar, or custom component)
  • Primary title with optional subtitle
  • Trailing elements for actions or indicators
  • Link navigation via href
  • Press handling support
  • Automatic disabled state styling
  • Dark mode compatible

Props

PropTypeDefaultDescription
titleReact.ReactNodeRequiredPrimary text or component
subtitleReact.ReactNodeSecondary text or component
leadingReact.ReactNodeCustom leading component
avatar{ src?: string, name?: string, size?: 'xs' | 'sm' | 'md' }Avatar configuration
iconIconConfigIcon configuration for leading element
trailingReact.ReactNodeCustom trailing component
trailingIconIconConfigIcon configuration for trailing element
disabledbooleanfalseWhether the item is disabled
classNamestring''Additional Tailwind classes
styleViewStyleAdditional style object
hrefstringNavigation link destination
onPress() => voidHandler for press events

Basic Usage

// Basic list item with title and subtitle
<ListItem 
  title="Account Settings"
  subtitle="Manage your profile and preferences"
/>
 
// List item with icon and navigation
<ListItem
  title="Notifications"
  icon={{ name: "Bell" }}
  trailingIcon={{ name: "ChevronRight" }}
  href="/settings/notifications"
/>
 
// List item with avatar
<ListItem
  title="John Doe"
  subtitle="Online"
  avatar={{ src: "https://example.com/avatar.jpg", size: "sm" }}
  onPress={() => handleUserSelect()}
/>
 
// Disabled list item
<ListItem
  title="Premium Feature"
  subtitle="Upgrade your account to access"
  icon={{ name: "Lock" }}
  disabled
/>

On this page