List section
A labelled group of independently accessible rows.
npx @swipeui/cli add list-sectionWhen to use it
- Grouping related rows in settings, such as Account, Notifications and Privacy.
- Inset grouped lists like iOS Settings, or plain full-width sections.
- Adding a short explanation below a group of rows.
When not to use it
- Collapsible groups. Use Accordion.
- A single row.
- Grids or cards.
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-section- Adds
components/swipeui/ui/list-section.tsxand 4 shared helpers. - Installs react-native-reanimated, react-native-worklets, uniwind, clsx, tailwind-merge, class-variance-authority. In Expo apps it uses
npx expo installso versions match your SDK.
Usage
import { ListSection } from '@/components/swipeui/ui/list-section';
<ListSection title="Account" footer="Changes sync to your account.">
<ListRow title="Profile" onPress={openProfile} />
</ListSection>;API reference
| Prop | Type | Default | Description |
|---|---|---|---|
animateEntrance? | | | Fade newly added rows in. |
animateLayout? | | | Animate group resizing and row reflow. |
motion? | | — | Shared list motion character. |
title? | | — | Section heading. |
children | | — | Rows; each row keeps its own accessibility target. |
footer? | | — | Supporting text below the group. |
variant? | | | Surface treatment. |
surface? | | | Explicit surface; overrides variant. |
separators? | | | Draw quiet inset separators between children. |
separatorInset? | | | Separator inset from each logical edge, in points. |
headerAction? | | — | Optional independent action beside the section heading. |
className? | | — | Root classes. |
style? | | — | Root layout escape hatch. |
testID? | | — | Root identifier. |
Composition and behavior
- title heads the group; children are the rows; footer adds supporting text.
- variant is inset (rounded card) or plain.
Behavior and gestures
- Static; the rows inside handle their own taps.
Accessibility
- The title is a header, so screen reader users can jump between sections.
- Each row keeps its own focus stop.
- Footer text wraps fully at large sizes.
Motion
- Uses the
listmotion role, so it follows your app's feel. Passmotionto tune this one instance. - Independent optional entry and layout transitions respect reduced motion.
Performance
- A simple container.
Notes for AI
- Put List rows inside; use footer for short explanations.
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.