Skip to main content

ListItem list display item component

Effect demonstration

1. Default effect


<ListItem
title=" Lorem Ipsum is simply dummy text of the printing and typesetting industry.main title main title main title main title main title main title"
onPress={() => { console.log(111)}}
/>
<ListItem
title="Lorem Ipsum is simply dummy text of the printing and typesetting industry."
brief="Lorem Ipsum has been the industry's standard dummy text ever since the
1500s, when an unknown printer took a galley of type and scrambled it to
make a type specimen book."
/>
listItem-ios1.png

2. Add thumbnails on the left and image effects on the right

<ListItem
title="Main title"
brief="Subtitle below the main title"
thumb={<Image source={imgUrl} style={{width: 80, height: 80}}/>}
/>
<ListItem
title="extra is Image"
thumb={<Image source={imgUrl} style={{width: 80, height: 80}}/>}
extra={<Image source={imgUrl} style={{width: 80, height: 80}} />}
/>
listItem-ios2.png

3. Customize the right component and specify the arrow direction effect

<ListItem title="Main Title" extra={<Switch />} />
<ListItem title="Main title" brief="Subtitle below the main title" arrow="down" />
<ListItem title="Main title" brief="Subtitle below the main title" arrow="horizontal" />
<ListItem title="Main title" brief="Subtitle below the main title" arrow="up" />
listItem-ios3.png

4. The effect of wrapping text on the right and omitting too long text, and adding the required effect

<ListItem title="Long content" wrap extra="httpsos.alipayobjects.com/rmsportal/mOoPurdIfmcuqtr.png" required />
<ListItem title="long content" extra="httpsos.alipayobjects.com/rmsportal/mOoPurdIfmcuqtr.png" arrow="horizontal" />
listItem-ios5.png

API

PropertiesRequiredDescriptionTypeDefault Value
titletrueMain titleReactNode
brieffalseSubtitle below the main titleReactNode
extrafalseThe text or component on the rightReactNode
thumbfalsethumbnailReactNode
onPressfalsePressed callback function() => void
minHeightfalseMinimum heightnumber
stylefalseCustom styleViewStyle
requiredfalseWhether it is required, a red *sign will be displayed if requiredbooleanfalse
wrapfalseWhether to wrap linesbooleanfalse
arrowfalseThe right arrow indicates the directionhorizontal | down | up | ReactNode
activeOpacityfalseOpacity when pressed Ïnumber0.6
backgroundColorfalseList item background colortheme color