React Native / Core
ListItem
One row of a list. Read by screen readers as a single element, so a row like "RTX 4070, 12 GB, $549" is one swipe instead of three.
import { ListItem } from "@stylhero/native";
Example
import { View } from "react-native";
import { ListItem } from "@stylhero/native";
const noop = () => {};
function ListItemExample() {
return (
<View>
<ListItem title="RTX 4070 Super" subtitle="$589 at Newegg" chevron onPress={noop} />
<ListItem title="Ryzen 7 7800X3D" subtitle="$399 at Amazon" chevron onPress={noop} />
</View>
);
}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title required |
string |
- | |
accessibilityHint |
string |
- | |
accessibilityLabel |
string |
- | Overrides the spoken label (defaults to "title, subtitle"). |
chevron |
boolean |
- | Shows a ">" hint that the row opens something. Defaults to true when pressable. |
disabled |
boolean |
- | |
leading |
ReactNode |
- | Left slot: icon, Avatar, or product image. |
onPress |
() => void |
- | |
style |
StyleProp<ViewStyle> |
- | |
subtitle |
string |
- | |
testID |
string |
- | |
trailing |
ReactNode |
- | Right slot: price, Badge, Switch... |
Screen reader gestures
| Gesture (VoiceOver / TalkBack) | Does |
|---|---|
| Double-tap | Presses the row, with onPress |
Accessibility
- Title and subtitle are read as one element. The chevron is decorative and hidden from screen readers.
- Pressable rows are buttons with a 44pt minimum height.
Generated from src/components/ListItem.tsx. Something wrong or missing? Open an issue.