SwipeUI

Reorderable list

Variable-height reordering for bounded collections; parent owns scrolling, without edge autoscroll.

npx @swipeui/cli add reorderable-list
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When to use it

  • Letting people reorder a short list, such as playlist tracks, priorities or home screen sections.
  • Rows of different heights that need to be dragged into place.
  • Reordering that must also work without dragging.

When not to use it

  • Long lists that need virtualisation or edge autoscroll; it's built for bounded lists.
  • Sorting by a field. Offer a sort menu.
  • Kanban boards across columns.

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 reorderable-list
  • Adds components/swipeui/ui/reorderable-list.tsx, components/swipeui/ui/use-reorderable-row.ts and 6 shared helpers.
  • Installs react-native-gesture-handler, react-native-reanimated, react-native-worklets, uniwind, clsx, tailwind-merge, class-variance-authority, expo-haptics. In Expo apps it uses npx expo install so versions match your SDK.

Usage

app/tasks.tsx
import { ReorderableList } from '@/components/swipeui/ui/reorderable-list';

<ReorderableList items={tasks} onOrderChange={setOrder} />;

API reference

PropTypeDefaultDescription
onHandlePress?((id: string) => void)—

Optional tap alternative on the drag handle; the caller can open a position chooser.

dragActivation?"handle" | "row"'handle'

Where dragging begins.

showMoveControls?booleantrue

Keep single-tap movement alternatives visible.

liftFeedback?booleantrue

Scale the lifted row slightly.

animateReorder?booleantrue

Animate neighbouring rows and accepted order changes.

longPressDelay?number250

Hold delay before dragging, in milliseconds.

messages?object—

Text overrides; movement entries override legacy moveLabels.

itemsreadonly ReorderableListItem[]—

Ordered rows; the caller must accept order changes to update the display.

onOrderChange(ids: readonly string[]) => void—

Reports a complete ordered identifier list after an accepted movement.

disabled?boolean—

Disable dragging and movement actions.

moveLabels?readonly [string, string]['Move up', 'Move down']

Localized up/down labels.

haptics?boolean—

Drop feedback.

motion?MotionOverride—

Shared drag/reflow motion.

className?string—

Root classes.

style?StyleProp<ViewStyle>—

Root layout escape hatch.

testID?string—

Root identifier.

Composition and behavior

  • items each have an id, label and content.
  • onOrderChange receives the new id order.
  • moveLabels translate the move buttons.

Behavior and gestures

  • Press and hold a row for a quarter of a second, then drag it; other rows move aside.
  • Let go to drop it; a light tick confirms the new order.
  • Each row also has Move up and Move down buttons.
  • Your app must accept the new order for the list to update.

Accessibility

  • Each row offers Move up and Move down as buttons and accessibility actions, named like "Move up: Track 3".
  • Dragging is never required.
  • Labels can be translated with moveLabels.

Motion

  • Uses the list and press motion roles, so it follows your app's feel. Pass motion to tune this one instance.
  • Dragged rows follow your finger; others shift with the list spring.
  • Reduce Motion makes shifts instant.

Performance

  • Rows are measured once; drag runs on the UI thread.
  • The parent owns scrolling; there's no virtualisation.

Notes for AI

  • Update items from onOrderChange; it returns the full ordered id list.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items