Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
  • Layout & containers
  • Overlays
  • Feedback & status
  • Data display
    • Accordion
    • Accordion
    • Avatar
    • Avatar
    • Blobby
    • Card
    • Card
    • Collapsible
    • Divider
    • Emoji
    • Emoji
    • Gradient
    • Gradient
    • Icon
    • Image
    • ListItem
    • ListItem
    • ResponsiveImage
    • SemanticList
    • Tag
    • Timeline
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Data display
  • ListItem

ListItem (Mobile)

One row in a list, with a title, a subtitle and an optional decoration. Use for a tappable list of items.

Health
Component health
Source
View on Github
Accessibility

partially-compliant

Platform
Mobile
📱 Mobile-only
This component is only for mobile. To see how it looks like you can check the mobile storybook with:
yarn workspace alan-mobile dev:install-client -p ios
yarn workspace alan-mobile dev:storybook
Accessibility issues
This component supports accessibility labels via the `accessibilityLabel` prop.
  • Overview
  • Props
info

Mobile components cannot be previewed in the browser. Use Storybook mobile or run the app locally to test.

Usage​

import { ListItem } from "murray/mobile";

<ListItem
title="Title"
subtitle="Sub-title"
decorProps={{
type: "emoji",
visual: "🙈️",
size: "size40",
}}
onPress={() => {}}
/>;

Platform Differences​

The mobile ListItem has some differences from the web version:

  • Uses onPress instead of onClick for interaction handlers
  • Supports size prop ("sm" | "md") for different sizing
  • Has a subtitleView prop for custom subtitle rendering
  • Supports accessibilityLabel prop for accessibility
  • Includes a negative variant not available on web

ListItem props

NameTypeDefault ValueDescriptionUsage count
decorPropsDecorPropsundefined
errorReactNode
hideCaretbooleanundefinedWhen `onPress` is filled, caret is shown by default. You can disable it with this prop.
onPress
2 possibilities((event: GestureResponderEvent) => void)undefined
optionPropsListItemOptionPropsundefined
reserveCaretSpacebooleanundefinedReserve the caret's horizontal space even when no caret is shown, so options (e.g. amounts) stay right-aligned across rows in a list mixing pressable and non-pressable items. Set it on every row of the list.
size"sm""md"undefinedmd
style
5 possibilitiesundefinedViewStyleViewStyle & falseViewStyle & ""ViewStyle & RecursiveArray<Falsy | ViewStyle>
subtitleReactNode
subtitleViewReactNode
titleReactNode
titleColor
4 possibilitiesundefined`$${string}`Variable<any>OpaqueColorValue
Override the variant's default title color.
variantListItemVariantundefineddefault

Undocumented props

NameTypeDefault ValueDescriptionUsage count
accessibilityLabelany
accessibilityRoleany
testIDany
Edit this page
Previous
Image
Next
ListItem
  • Usage
  • Platform Differences