List row
A row for lists and settings screens with a title, subtitle, leading and trailing content, and an optional chevron.
npx @swipeui/cli add list-rowWhen to use it
- Settings screens with rows like Notifications, Privacy and Account.
- Lists of contacts, files or messages with a title and subtitle.
- Rows with a value or a Switch on the end.
- Rows that reveal swipe actions such as Archive or Delete.
When not to use it
- Rich content with images and actions. Use Card.
- Expanding content. Use Accordion.
- Grids of items. Use Feature tile or a grid.
Installation
Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.
npx @swipeui/cli add list-row- Adds
components/swipeui/ui/list-row.tsxand 7 shared helpers. - Installs clsx, tailwind-merge, react-native-reanimated, react-native-worklets, uniwind, expo-haptics, class-variance-authority, react-native-gesture-handler. In Expo apps it uses
npx expo installso versions match your SDK.
Usage
import { ListRow } from '@/components/swipeui/ui/list-row';
<ListRow title="Notifications" subtitle="Banners, sounds and badges" onPress={openNotifications} />
<ListRow title="Dark mode" trailing={<Switch accessibilityLabel="Dark mode" />} />Group rows in a bordered container:
<View className="overflow-hidden rounded-lg border border-border">
<ListRow title="Account" onPress={openAccount} />
<ListRow title="Privacy" onPress={openPrivacy} />
</View>API reference
| Prop | Type | Default | Description |
|---|---|---|---|
trailingAlignment? | | | Align the trailing slot with the top text line. |
showSwipeActionButtons? | | | Show persistent swipe action alternatives. Accessibility actions remain. |
swipeActionLayout? | | | Keep non-gesture swipe alternatives beside or below the row. |
appearance? | | | Resting surface; grouped rows normally stay plain. |
density? | | | Vertical spacing; both retain a 44pt minimum. |
startActions? | | — | Actions at logical start, also exposed as named buttons. |
endActions? | | — | Actions at logical end, also exposed as named buttons. |
fullSwipe? | | | Whether a full swipe commits. |
onSwipeError? | | — | Receives asynchronous swipe failures. |
title | | — | The main line. It names the row for screen readers even when |
titleContent? | | | Draws the main line instead of the plain |
subtitle? | | — | A second, quieter line. |
leading? | | — | Shown before the text, such as an icon or |
trailing? | | — | Shown after the text, such as a value, |
chevron? | | | Shows a chevron at the end, pointing the reading direction. |
onPress? | | — | Makes the row pressable, announced as a button. |
disabled? | | | Prevent primary and swipe activation. |
haptics? | | | Plays a selection tick on press. |
motion? | | | Local motion feel or spring override. |
accessibilityLabel? | | — | Overrides the label read by screen readers for pressable rows (title and subtitle by default). |
accessibilityHint? | | — | |
className? | | — | Classes merged over the row. |
style? | | — | Style escape hatch for the row. |
testID? | | — |
Composition and behavior
- title and subtitle text with leading and trailing slots.
- onPress makes it a button; chevron shows the arrow.
- startActions, endActions and fullSwipe add Swipe actions.
Behavior and gestures
- With onPress, tap the row to open it; it gives a gentle press and a selection tick, and shows a chevron by default.
- Without onPress, the row is plain content and controls in trailing work on their own.
- With startActions or endActions, swipe the row to reveal actions.
- Disabled rows dim and ignore taps.
Accessibility
- A tappable row is one button named by its title and subtitle, such as "Notifications, On".
- The chevron is hidden from screen readers and points the other way in right-to-left layouts.
- Without onPress, the row isn't grouped, so a Switch in trailing stays reachable on its own.
- Swipe actions are also available as named buttons and accessibility actions.
Motion
- Uses the
pressmotion role, so it follows your app's feel. Passmotionto tune this one instance. - Uses the shared press scale; swipes use the drag spring.
- Reduce Motion removes the scale.
Performance
- Light enough for long FlatLists.
Notes for AI
- Don't put a pressable control in trailing of a pressable row; two nested buttons confuse screen readers.
Compatibility
| Runs on | Supported |
|---|---|
| Expo SDK 57 | Yes |
| Expo SDK 58 | Yes |
| React Native CLI (with Expo modules) | Yes |
| Expo Go | Yes |
| iOS | Yes |
| Android | Yes |
This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.