react-native-swipeable-actions 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,29 @@ the entry for the matching version.
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 1.2.0 - 2026-11-13
9
+
10
+ Install it with `npx expo install react-native-swipeable-actions@^1`. The release
11
+ changes no native code. It has no breaking changes for typed callers. Read the entry
12
+ under Changed if a row passes a width with `undefined` content.
13
+
14
+ ### Added
15
+
16
+ - `isRTL` prop. It mirrors a row for a right-to-left layout: the `left` and `right`
17
+ props, `open(side)`, `Swipeable.open(key, side)`, `onLeftSwipeEnd` and
18
+ `onRightSwipeEnd` then refer to the opposite physical edge, and the `left` and
19
+ `right` values of `gestureInsets` swap. The default is `false`, so rows that map
20
+ their sides in the app do not change.
21
+ - A side with a width and no content. `<Swipeable leftActionsWidth={width}>` enables
22
+ the left side with an empty rail, so a swipe-to-go-back screen needs no empty
23
+ `<View />` as content.
24
+
25
+ ### Changed
26
+
27
+ - A side that has a width and `undefined` content is now enabled. Before, it was off
28
+ and a development warning said that the width was ignored. Pass `null` or `false`
29
+ as the content to keep a side off.
30
+
8
31
  ## 1.1.0 - 2026-11-13
9
32
 
10
33
  Install it with `npx expo install react-native-swipeable-actions@^1`. The release
package/README.md CHANGED
@@ -81,7 +81,9 @@ Each side is a pair: content plus its width in layout units.
81
81
  - The width is the full reveal distance, including padding and gaps. The library
82
82
  does not measure action content.
83
83
  - The action rail spans the row. Give the action content its own width and height.
84
- - Omit a side, or pass `null` or `false`, to disable it. Omit its width too.
84
+ - A width alone enables its side with an empty rail. Nothing shows behind the content.
85
+ - To turn a side off, omit its width. `null` or `false` content also turns the side
86
+ off, with or without a width.
85
87
  - A disabled side never falls back to the other side.
86
88
 
87
89
  ## Two-sided rows
@@ -155,8 +157,8 @@ stays open and does not report `onSwipeEnd`.
155
157
  ## Swipe to go back
156
158
 
157
159
  Wrap a whole screen to slide it right with the finger. A full swipe goes back, and
158
- nothing shows behind the screen. Give the left side empty content as wide as the
159
- window. Do not pass `null`, because `null` disables the side.
160
+ nothing shows behind the screen. Give the left side a width as wide as the window and
161
+ no content.
160
162
 
161
163
  ```tsx
162
164
  const { width } = useWindowDimensions();
@@ -166,8 +168,8 @@ const key = useId();
166
168
  <Swipeable
167
169
  ref={screen}
168
170
  recyclingKey={key}
169
- leftActions={<View />}
170
171
  leftActionsWidth={width}
172
+ isRTL={I18nManager.isRTL}
171
173
  dragOffsetFromEdge={20}
172
174
  onSwipeStart={() => hasUnsavedDraft() && screen.current?.cancel()}
173
175
  onSwipeEnd={(state) => {
@@ -190,6 +192,8 @@ const key = useId();
190
192
  Then a later mount does not restore the open state of a screen that you swiped away.
191
193
  - If the navigator has its own back gesture on that screen, turn it off. For a
192
194
  native stack, set `gestureEnabled: false`.
195
+ - `isRTL={I18nManager.isRTL}` makes the screen slide left in a right-to-left layout.
196
+ Leave it out if the swipe must go right in every layout.
193
197
 
194
198
  The example app has a small reusable wrapper,
195
199
  [`SwipeToGoBack`](https://github.com/chocky335/react-native-swipeable-actions/blob/main/example/components/SwipeToGoBack.tsx).
@@ -205,7 +209,6 @@ else still swipes the screen.
205
209
  ```tsx
206
210
  <Swipeable
207
211
  recyclingKey={key}
208
- leftActions={<View />}
209
212
  leftActionsWidth={width}
210
213
  gestureInsets={{ bottom: pagerHeight }}
211
214
  >
@@ -280,10 +283,45 @@ The example list row uses the same pattern.
280
283
 
281
284
  ## RTL
282
285
 
283
- `left` and `right` are physical edges in every layout direction. RTL does not swap
284
- action content, widths, commands or side callbacks. If your app thinks in logical
285
- start/end actions, map them to left/right yourself.
286
+ By default `left` and `right` are physical edges in every layout direction. React
287
+ Native's global RTL setting does not swap action content, widths, commands or side
288
+ callbacks.
286
289
 
290
+ To mirror a row, pass `isRTL`. Write the row once for a left-to-right layout:
291
+
292
+ ```tsx
293
+ <Swipeable
294
+ isRTL={I18nManager.isRTL}
295
+ leftActions={<ReplyAction />}
296
+ leftActionsWidth={72}
297
+ rightActions={<DeleteAction />}
298
+ rightActionsWidth={88}
299
+ onRightSwipeEnd={(state) => state === "open" && remove(item.id)}
300
+ >
301
+ <Message item={item} />
302
+ </Swipeable>
303
+ ```
304
+
305
+ With `isRTL` on, every side name refers to the opposite physical edge:
306
+
307
+ - `rightActions` and `rightActionsWidth` sit on the left edge, and a drag to the
308
+ right reveals them. The `left` pair sits on the right edge.
309
+ - `open("right")` and `Swipeable.open(key, "right")` open the `rightActions`.
310
+ `open()` with no side still prefers `rightActions`, then `leftActions`.
311
+ - `onRightSwipeEnd` runs for the `rightActions`, and `onLeftSwipeEnd` for the
312
+ `leftActions`.
313
+
314
+ `isRTL` is a plain boolean. The library does not read `I18nManager` for it, so an app
315
+ that already maps its sides for RTL is not mirrored twice. Any other flag works too,
316
+ for example a chat that mirrors only incoming messages.
317
+
318
+ - `isRTL` moves whole sides. It does not reorder the buttons inside your action
319
+ content. React Native lays that content out in the app's layout direction.
320
+ - Each rail keeps its content against its own physical edge in both layout
321
+ directions (fixed in 1.0.0), so mirrored actions still start at the outer edge.
322
+ - `isRTL` also swaps the `left` and `right` values of `gestureInsets`.
323
+ - The raw `SwipeableView` props stay physical.
324
+ - A static command mirrors its side only while the `isRTL` row is mounted.
287
325
  - Close open rows before you swap which actions sit on which physical side.
288
326
  - A translated label can need a new width. Update the width with the label.
289
327
  - A change to React Native's global RTL setting (`I18nManager.forceRTL`) needs an
@@ -314,8 +352,9 @@ start/end actions, map them to left/right yourself.
314
352
  | Prop | Type | Default | Description |
315
353
  | --- | --- | --- | --- |
316
354
  | `children` | `ReactNode` | required | Row content. |
317
- | `leftActions` / `rightActions` | `ReactNode` | - | Action content for that physical side. `null`/`false` disables the side. At least one side is required. |
318
- | `leftActionsWidth` / `rightActionsWidth` | `number` | - | Required with its content. Finite and positive. |
355
+ | `leftActions` / `rightActions` | `ReactNode` | - | Action content for that side. Optional when the side has a width. `null`/`false` disables the side. |
356
+ | `leftActionsWidth` / `rightActionsWidth` | `number` | - | Enables its side. Finite and positive. At least one side is required. |
357
+ | `isRTL` | `boolean` | `false` | Mirrors the sides, the commands and the side callbacks. See [RTL](#rtl). |
319
358
  | `recyclingKey` | `string \| number` | - | Stable item key. Required for ref commands, static commands and list state restoration. |
320
359
  | `threshold` | `number` | `0.4` | Fraction (0-1) of the active side's width a release must pass to open. |
321
360
  | `friction` | `number` | `1` | Drag damping (0-1). Lower values add resistance. |
@@ -347,7 +386,7 @@ not swipes.
347
386
 
348
387
  | Ref method | Static method | Description |
349
388
  | --- | --- | --- |
350
- | `open(side?)` | `Swipeable.open(key, side?)` | Open a side. Without a side: right if enabled, else left. |
389
+ | `open(side?)` | `Swipeable.open(key, side?)` | Open a side by its prop name. Without a side: right if enabled, else left. |
351
390
  | `close(animated = true)` | `Swipeable.close(key, animated = true)` | Close the row. |
352
391
  | `cancel()` | `Swipeable.cancel(key)` | Close at once. A gesture in progress or a pending open does not complete. |
353
392
  | - | `Swipeable.closeAll(animated = true)` | Close all rows, including rows that are not mounted (scrolled off or on a covered screen). Those rows come back closed. |
@@ -412,6 +451,9 @@ fireEvent(row, "swipeEnd", {
412
451
  The other native events are `swipeStateChange` (`{ state, side }`) and
413
452
  `swipeProgress` (`{ progress, translationX, side }`).
414
453
 
454
+ The `side` in a native event is the physical side. For a row with `isRTL`, a native
455
+ `side: "left"` runs `onRightSwipeEnd`.
456
+
415
457
  ## Compatibility
416
458
 
417
459
  | | Tested for 1.0 |
@@ -1 +1 @@
1
- {"version":3,"file":"Swipeable.d.ts","sourceRoot":"","sources":["../src/Swipeable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAQnB,MAAM,OAAO,CAAA;AAYd,OAAO,KAAK,EAIV,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EAIhB,MAAM,mBAAmB,CAAA;AAqQ1B,KAAK,mBAAmB,GAAG,yBAAyB,CAClD,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAC1D,GACC,eAAe,CAAA;AAEjB,QAAA,MAAM,eAAe,EAAgB,mBAAmB,CAAA;AA+BxD,eAAe,eAAe,CAAA"}
1
+ {"version":3,"file":"Swipeable.d.ts","sourceRoot":"","sources":["../src/Swipeable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EASnB,MAAM,OAAO,CAAA;AAYd,OAAO,KAAK,EAIV,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EAIhB,MAAM,mBAAmB,CAAA;AAgU1B,KAAK,mBAAmB,GAAG,yBAAyB,CAClD,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAC1D,GACC,eAAe,CAAA;AAEjB,QAAA,MAAM,eAAe,EAAgB,mBAAmB,CAAA;AA8BxD,eAAe,eAAe,CAAA"}
@@ -19,14 +19,58 @@ function normalizeRecyclingKey(key) {
19
19
  }
20
20
  return undefined;
21
21
  }
22
- const Swipeable = (0, react_1.forwardRef)(function Swipeable({ children, leftActions, leftActionsWidth, rightActions, rightActionsWidth, onLeftSwipeEnd, onRightSwipeEnd, appearance = 'default', hapticFeedback, friction = constants_1.SWIPE_DEFAULTS.FRICTION, threshold = constants_1.SWIPE_DEFAULTS.THRESHOLD, gestureEnabled = constants_1.SWIPE_DEFAULTS.GESTURE_ENABLED, gestureInsets, dragOffsetFromEdge = constants_1.SWIPE_DEFAULTS.DRAG_OFFSET_FROM_EDGE, style, testID, onSwipeStart, onSwipeStateChange, onSwipeEnd, onProgress, autoClose = false, autoCloseTimeout = 0, recyclingKey }, ref) {
22
+ const mirror = (side) => (side === 'left' ? 'right' : 'left');
23
+ // A static command has only the key, so each mounted isRTL row lists its default side here.
24
+ const mirroredRows = new Map();
25
+ /** The native side for a command, `undefined` for the native default, `null` for no side. */
26
+ function nativeOpenSide(side, defaultSide) {
27
+ if (!defaultSide)
28
+ return side;
29
+ const named = side ?? defaultSide();
30
+ return named ? mirror(named) : null;
31
+ }
32
+ /** Like the native default: the right side if it is enabled, else the left side. */
33
+ function defaultOpenSide(leftWidth, rightWidth) {
34
+ if (rightWidth > 0)
35
+ return 'right';
36
+ return leftWidth > 0 ? 'left' : null;
37
+ }
38
+ function openNative(key, side) {
39
+ if (side === undefined)
40
+ (0, nativeModuleUtils_1.openByKey)(key);
41
+ else if (side)
42
+ (0, nativeModuleUtils_1.openByKeyOnSide)(key, side);
43
+ }
44
+ const Swipeable = (0, react_1.forwardRef)(function Swipeable({ children, leftActions, leftActionsWidth, rightActions, rightActionsWidth, isRTL = false, onLeftSwipeEnd, onRightSwipeEnd, appearance = 'default', hapticFeedback, friction = constants_1.SWIPE_DEFAULTS.FRICTION, threshold = constants_1.SWIPE_DEFAULTS.THRESHOLD, gestureEnabled = constants_1.SWIPE_DEFAULTS.GESTURE_ENABLED, gestureInsets, dragOffsetFromEdge = constants_1.SWIPE_DEFAULTS.DRAG_OFFSET_FROM_EDGE, style, testID, onSwipeStart, onSwipeStateChange, onSwipeEnd, onProgress, autoClose = false, autoCloseTimeout = 0, recyclingKey }, ref) {
23
45
  const nativeRef = (0, react_1.useRef)(null);
24
- const resolved = (0, react_1.useMemo)(() => (0, resolveSwipeableActions_1.resolveSwipeableActions)({
46
+ const named = (0, react_1.useMemo)(() => (0, resolveSwipeableActions_1.resolveSwipeableActions)({
25
47
  leftActions,
26
48
  ...(leftActionsWidth !== undefined ? { leftActionsWidth } : {}),
27
49
  rightActions,
28
50
  ...(rightActionsWidth !== undefined ? { rightActionsWidth } : {})
29
51
  }), [leftActions, leftActionsWidth, rightActions, rightActionsWidth]);
52
+ // From here on `resolved` holds the native, physical sides.
53
+ const resolved = (0, react_1.useMemo)(() => (isRTL ? { ...named, left: named.right, right: named.left } : named), [isRTL, named]);
54
+ const insetProps = (0, react_1.useMemo)(() => {
55
+ if (!gestureInsets)
56
+ return null;
57
+ if (!isRTL)
58
+ return { gestureInsets };
59
+ const { left, right, ...vertical } = gestureInsets;
60
+ return {
61
+ gestureInsets: {
62
+ ...vertical,
63
+ ...(right !== undefined ? { left: right } : {}),
64
+ ...(left !== undefined ? { right: left } : {})
65
+ }
66
+ };
67
+ }, [gestureInsets, isRTL]);
68
+ // The ref handle and the static registry outlive a render, so they read through refs.
69
+ const isRTLRef = (0, react_1.useRef)(isRTL);
70
+ isRTLRef.current = isRTL;
71
+ const defaultSideRef = (0, react_1.useRef)(null);
72
+ defaultSideRef.current = defaultOpenSide(named.left.width, named.right.width);
73
+ const readDefaultSide = (0, react_1.useCallback)(() => defaultSideRef.current, []);
30
74
  // Normalize recyclingKey before hooks that depend on it
31
75
  const normalizedKey = normalizeRecyclingKey(recyclingKey);
32
76
  const recyclingKeyRef = (0, react_1.useRef)(undefined);
@@ -45,6 +89,16 @@ const Swipeable = (0, react_1.forwardRef)(function Swipeable({ children, leftAct
45
89
  setRenderedSides((previous) => (previous.key === normalizedKey ? previous : initialSides));
46
90
  swipeStartedRef.current = false;
47
91
  }, [initialSides, normalizedKey]);
92
+ // A layout effect, so a static command from any passive mount effect sees the row.
93
+ (0, react_1.useLayoutEffect)(() => {
94
+ if (!isRTL || !normalizedKey)
95
+ return;
96
+ mirroredRows.set(normalizedKey, readDefaultSide);
97
+ return () => {
98
+ if (mirroredRows.get(normalizedKey) === readDefaultSide)
99
+ mirroredRows.delete(normalizedKey);
100
+ };
101
+ }, [isRTL, normalizedKey, readDefaultSide]);
48
102
  const warningText = resolved.warnings.join('\n');
49
103
  (0, react_1.useEffect)(() => {
50
104
  if (__DEV__ && warningText)
@@ -70,10 +124,7 @@ const Swipeable = (0, react_1.forwardRef)(function Swipeable({ children, leftAct
70
124
  open: (side) => {
71
125
  const key = recyclingKeyRef.current;
72
126
  if (key) {
73
- if (side === undefined)
74
- (0, nativeModuleUtils_1.openByKey)(key);
75
- else
76
- (0, nativeModuleUtils_1.openByKeyOnSide)(key, side);
127
+ openNative(key, nativeOpenSide(side, isRTLRef.current ? readDefaultSide : undefined));
77
128
  }
78
129
  else if (__DEV__) {
79
130
  console.warn('[Swipeable] open() called without recyclingKey - method has no effect');
@@ -92,7 +143,7 @@ const Swipeable = (0, react_1.forwardRef)(function Swipeable({ children, leftAct
92
143
  console.warn('[Swipeable] cancel() called without recyclingKey - method has no effect');
93
144
  }
94
145
  }
95
- }), []);
146
+ }), [readDefaultSide]);
96
147
  const handleSwipeStart = (0, react_1.useCallback)((event) => {
97
148
  // Missing metadata identifies the unkeyed native binding. It must not
98
149
  // bypass identity checks after recycling into a keyed row.
@@ -136,15 +187,16 @@ const Swipeable = (0, react_1.forwardRef)(function Swipeable({ children, leftAct
136
187
  return;
137
188
  swipeStartedRef.current = false;
138
189
  onSwipeEnd?.(event.nativeEvent.state);
139
- const side = event.nativeEvent.side;
190
+ const nativeSide = event.nativeEvent.side;
191
+ const side = isRTL && nativeSide ? mirror(nativeSide) : nativeSide;
140
192
  if (side === 'left')
141
193
  onLeftSwipeEnd?.(event.nativeEvent.state);
142
194
  if (side === 'right')
143
195
  onRightSwipeEnd?.(event.nativeEvent.state);
144
- }, [normalizedKey, onLeftSwipeEnd, onRightSwipeEnd, onSwipeEnd]);
196
+ }, [isRTL, normalizedKey, onLeftSwipeEnd, onRightSwipeEnd, onSwipeEnd]);
145
197
  return (<SwipeableView_1.SwipeableView ref={nativeRef} style={[styles.container, style]} leftActionsWidth={resolved.left.width} rightActionsWidth={resolved.right.width} onActionsNeeded={handleActionsNeeded} {...(react_native_1.Platform.OS === 'ios'
146
198
  ? { appearance, hapticFeedback: hapticFeedback ?? appearance === 'ios26' }
147
- : {})} friction={friction} threshold={threshold} gestureEnabled={gestureEnabled} {...(gestureInsets ? { gestureInsets } : {})} dragOffsetFromEdge={dragOffsetFromEdge} autoClose={autoClose} autoCloseTimeout={autoCloseTimeout} {...(normalizedKey ? { recyclingKey: normalizedKey } : {})} {...(testID ? { testID } : {})} onSwipeStart={handleSwipeStart} onGestureCancelled={handleGestureCancelled} onSwipeProgress={handleSwipeProgress} onSwipeStateChange={handleSwipeStateChange} onSwipeEnd={handleSwipeEnd}>
199
+ : {})} friction={friction} threshold={threshold} gestureEnabled={gestureEnabled} {...insetProps} dragOffsetFromEdge={dragOffsetFromEdge} autoClose={autoClose} autoCloseTimeout={autoCloseTimeout} {...(normalizedKey ? { recyclingKey: normalizedKey } : {})} {...(testID ? { testID } : {})} onSwipeStart={handleSwipeStart} onGestureCancelled={handleGestureCancelled} onSwipeProgress={handleSwipeProgress} onSwipeStateChange={handleSwipeStateChange} onSwipeEnd={handleSwipeEnd}>
148
200
  <SwipeableActions_1.SwipeableActions key='left-slot' actionsPosition='left' {...(testID ? { testID: `${testID}-left-actions` } : {})}>
149
201
  <react_1.Fragment key={normalizedKey ?? ''}>
150
202
  {sides.left && resolved.left.width > 0 ? resolved.left.node : null}
@@ -177,10 +229,7 @@ SwipeableExport.open = (recyclingKey, side) => {
177
229
  console.warn('[Swipeable.open] recyclingKey must be a non-empty string');
178
230
  return;
179
231
  }
180
- if (side === undefined)
181
- (0, nativeModuleUtils_1.openByKey)(recyclingKey);
182
- else
183
- (0, nativeModuleUtils_1.openByKeyOnSide)(recyclingKey, side);
232
+ openNative(recyclingKey, nativeOpenSide(side, mirroredRows.get(recyclingKey)));
184
233
  };
185
234
  SwipeableExport.close = (recyclingKey, animated) => {
186
235
  if (__DEV__ && (!recyclingKey || typeof recyclingKey !== 'string')) {
@@ -1 +1 @@
1
- {"version":3,"file":"Swipeable.js","sourceRoot":"","sources":["../src/Swipeable.tsx"],"names":[],"mappings":";;AAAA,iCAWc;AACd,+CAAyD;AACzD,2CAA4C;AAC5C,2DAO4B;AAC5B,uEAAmE;AAYnE,yDAAqD;AACrD,mDAA+C;AAE/C,SAAS,qBAAqB,CAAC,GAAgC;IAC7D,IAAI,GAAG,IAAI,IAAI;QAAE,OAAO,SAAS,CAAA;IACjC,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAA;IACvC,IAAI,OAAO,GAAG,KAAK,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EAAE,QAAkB,EAAE,EAAE;IACnE,IAAI,OAAO,IAAI,CAAC,CAAC,YAAY,IAAI,OAAO,YAAY,KAAK,QAAQ,CAAC,EAAE,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAA;QACzE,OAAM;IACR,CAAC;IACD,IAAA,8BAAU,EAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,eAAe,CAAC,MAAM,GAAG,CAAC,YAAoB,EAAE,EAAE;IAChD,IAAI,OAAO,IAAI,CAAC,CAAC,YAAY,IAAI,OAAO,YAAY,KAAK,QAAQ,CAAC,EAAE,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAA;QAC1E,OAAM;IACR,CAAC;IACD,IAAA,+BAAW,EAAC,YAAY,CAAC,CAAA;AAC3B,CAAC,CAAA;AAED,eAAe,CAAC,QAAQ,GAAG,CAAC,QAAkB,EAAE,EAAE;IAChD,IAAA,4BAAQ,EAAC,QAAQ,CAAC,CAAA;AACpB,CAAC,CAAA;AAED,kBAAe,eAAe,CAAA"}
@@ -79,6 +79,13 @@ export interface SwipeableCommonProps {
79
79
  friction?: number;
80
80
  threshold?: number;
81
81
  gestureEnabled?: boolean;
82
+ /**
83
+ * Mirrors the row for a right-to-left layout. The `left` props, `open('left')` and
84
+ * `onLeftSwipeEnd` then act on the right edge, and the `right` ones on the left edge.
85
+ * The `left` and `right` values of `gestureInsets` swap too.
86
+ * Defaults to `false`: the sides are physical edges in every layout direction.
87
+ */
88
+ isRTL?: boolean;
82
89
  /**
83
90
  * Edge bands where a touch does not start a swipe. The children handle that touch,
84
91
  * for example a horizontal pager. Applies while the row is closed and at rest.
@@ -98,7 +105,7 @@ export interface SwipeableCommonProps {
98
105
  }
99
106
  export interface SwipeableMethods {
100
107
  close: (animated?: boolean) => void;
101
- /** Open the requested physical edge; without a side, prefer enabled right, then left. */
108
+ /** Open the requested side; without a side, prefer enabled right, then left. */
102
109
  open: (side?: SwipeSide) => void;
103
110
  cancel: () => void;
104
111
  }
@@ -109,24 +116,28 @@ export interface SwipeableStatic {
109
116
  closeAll: (animated?: boolean) => void;
110
117
  }
111
118
  type LeftActionsConfiguration = {
112
- leftActions: ReactNode;
119
+ leftActions?: ReactNode;
113
120
  leftActionsWidth: number;
114
121
  } | {
115
122
  leftActions?: null | false | undefined;
116
123
  leftActionsWidth?: never;
117
124
  };
118
125
  type RightActionsConfiguration = {
119
- rightActions: ReactNode;
126
+ rightActions?: ReactNode;
120
127
  rightActionsWidth: number;
121
128
  } | {
122
129
  rightActions?: null | false | undefined;
123
130
  rightActionsWidth?: never;
124
131
  };
125
- /** The sole action API: explicit physical-edge pairs, including single-sided rows. */
132
+ /** The sole action API: explicit side pairs, physical edges unless `isRTL` mirrors them. */
126
133
  export type SwipeableProps = SwipeableCommonProps & LeftActionsConfiguration & RightActionsConfiguration & ({
127
134
  leftActions: ReactNode;
128
135
  } | {
129
136
  rightActions: ReactNode;
137
+ } | {
138
+ leftActionsWidth: number;
139
+ } | {
140
+ rightActionsWidth: number;
130
141
  });
131
142
  /** Descriptive alias for the same explicit-side API, not a separate implementation. */
132
143
  export type TwoSidedSwipeableProps = SwipeableProps;
@@ -1 +1 @@
1
- {"version":3,"file":"Swipeable.types.d.ts","sourceRoot":"","sources":["../src/Swipeable.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnE,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;AACxC,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,CAAA;AAEjD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAA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YAAY,CAAC,EAAE,SAAS,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,YAAY,CAAC,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS,CAAC;IAAC,iBAAiB,CAAC,EAAE,KAAK,CAAA;CAAE,CAAA;AAE1E,4FAA4F;AAC5F,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAC/C,wBAAwB,GACxB,yBAAyB,GACzB,CACI;IAAE,WAAW,EAAE,SAAS,CAAA;CAAE,GAC1B;IAAE,YAAY,EAAE,SAAS,CAAA;CAAE,GAC3B;IAAE,gBAAgB,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAChC,CAAA;AAEH,uFAAuF;AACvF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAA;AACnD,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveSwipeableActions.d.ts","sourceRoot":"","sources":["../src/resolveSwipeableActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,UAAU,YAAY;IACpB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd;AAMD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY;;;;EAiB1D"}
1
+ {"version":3,"file":"resolveSwipeableActions.d.ts","sourceRoot":"","sources":["../src/resolveSwipeableActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,UAAU,YAAY;IACpB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd;AAMD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY;;;;EAgB1D"}
@@ -6,16 +6,16 @@ const isWidth = (width) => width !== undefined && Number.isFinite(width) && widt
6
6
  function resolveSwipeableActions(input) {
7
7
  const warnings = [];
8
8
  const resolve = (side, node, width) => {
9
+ // null and false turn a side off. undefined leaves the width in charge: an empty rail.
10
+ if (node !== undefined && !isContent(node))
11
+ return { node: null, width: 0 };
12
+ if (isWidth(width))
13
+ return { node: node ?? null, width };
9
14
  if (node !== undefined) {
10
- if (!isContent(node))
11
- return { node: null, width: 0 };
12
- if (isWidth(width))
13
- return { node, width };
14
15
  warnings.push(side + 'Actions requires a finite, positive ' + side + 'ActionsWidth.');
15
- return { node: null, width: 0 };
16
16
  }
17
- if (width !== undefined) {
18
- warnings.push(side + 'ActionsWidth is ignored without explicit ' + side + 'Actions.');
17
+ else if (width !== undefined) {
18
+ warnings.push(`${side}ActionsWidth must be finite and positive.`);
19
19
  }
20
20
  return { node: null, width: 0 };
21
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"resolveSwipeableActions.js","sourceRoot":"","sources":["../src/resolveSwipeableActions.ts"],"names":[],"mappings":";;AAmBA,0DAiBC;AArBD,MAAM,SAAS,GAAG,CAAC,IAAe,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,SAAS,CAAA;AAChF,MAAM,OAAO,GAAG,CAAC,KAAyB,EAAmB,EAAE,CAC7D,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAA;AAE5D,SAA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AAC"}
@@ -92,13 +92,14 @@ the whole screen, for example to swipe back. Before:
92
92
  After:
93
93
 
94
94
  ```tsx
95
- <Swipeable leftActions={<View />} leftActionsWidth={width}>
95
+ <Swipeable leftActionsWidth={width}>
96
96
  <Screen />
97
97
  </Swipeable>
98
98
  ```
99
99
 
100
- In v1, `null` disables the side, so the swipe does not start. An empty `<View />`
101
- keeps the side enabled and shows nothing behind the content. See
100
+ In v1, `null` disables the side, so the swipe does not start. A width with no content
101
+ keeps the side enabled and shows nothing behind the content. This form needs 1.2.0
102
+ or later. On 1.0 and 1.1, pass an empty view: `leftActions={<View />}`. See
102
103
  [Swipe to go back](../README.md#swipe-to-go-back) for the full recipe.
103
104
 
104
105
  ## Types: removed inputs versus retained aliases
@@ -178,7 +179,8 @@ one or both explicit sides; they do not restore removed API inputs or behaviors.
178
179
 
179
180
  ## RTL and app migration checklist
180
181
 
181
- 1. Map logical start/end actions to physical left/right in your app. RTL does not
182
+ 1. Map logical start/end actions to physical left/right in your app, or pass `isRTL`
183
+ (1.2.0 or later) and let the library mirror the row. Without `isRTL`, RTL does not
182
184
  exchange the library's sides, widths, command arguments or side callbacks.
183
185
  2. Update examples, wrappers, mocks and type fixtures to complete explicit pairs.
184
186
  3. Keep action padding/gaps inside the declared width and preserve usable targets.
package/docs/support.md CHANGED
@@ -44,16 +44,16 @@ The package declares these ranges. They are minimums, not a tested matrix.
44
44
 
45
45
  ## Tested for 1.x
46
46
 
47
- Each 1.x release must pass a full CI run on every configuration below. The E2E suite has 63 cases
48
- (25 single-sided, 19 two-sided, 14 RTL, 4 swipe to go back, 1 performance) plus the
47
+ Each 1.x release must pass a full CI run on every configuration below. The E2E suite has 65 cases
48
+ (25 single-sided, 21 two-sided, 14 RTL, 4 swipe to go back, 1 performance) plus the
49
49
  Maestro flows.
50
50
 
51
51
  | Area | Configuration | What ran |
52
52
  | --- | --- | --- |
53
53
  | App stack | Expo SDK 54.0, React Native 0.81.5, React 19.1.0 | Example app and a clean app that installs the packed tarball |
54
54
  | Architecture | New Architecture (Fabric), Hermes | All runs below |
55
- | Android | API 34 x86_64 emulator (Pixel 6 profile) | 63 E2E cases, Robolectric unit tests |
56
- | iOS | iOS 26.4 simulator (iPhone 17 Pro), Xcode 26.6 | 63 E2E cases, Maestro flows, Swift unit tests |
55
+ | Android | API 34 x86_64 emulator (Pixel 6 profile) | 65 E2E cases, Robolectric unit tests |
56
+ | iOS | iOS 26.4 simulator (iPhone 17 Pro), Xcode 26.6 | 65 E2E cases, Maestro flows, Swift unit tests |
57
57
  | Packaging | `npm pack` tarball in a clean Expo app | Install, type check, autolinking, release builds on both platforms |
58
58
 
59
59
  The Swift unit tests run with `swift test` on macOS in the `test-ios` CI job. They
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-swipeable-actions",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Native swipeable rows with swipe actions for React Native (iOS/Android). No Reanimated.",
5
5
  "main": "src/index.ts",
6
6
  "types": "build/index.d.ts",
package/src/Swipeable.tsx CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  useCallback,
7
7
  useEffect,
8
8
  useImperativeHandle,
9
+ useLayoutEffect,
9
10
  useMemo,
10
11
  useRef,
11
12
  useState
@@ -46,6 +47,32 @@ function normalizeRecyclingKey(key: string | number | undefined): string | undef
46
47
  return undefined
47
48
  }
48
49
 
50
+ const mirror = (side: SwipeSide): SwipeSide => (side === 'left' ? 'right' : 'left')
51
+
52
+ // A static command has only the key, so each mounted isRTL row lists its default side here.
53
+ const mirroredRows = new Map<string, () => SwipeSide | null>()
54
+
55
+ /** The native side for a command, `undefined` for the native default, `null` for no side. */
56
+ function nativeOpenSide(
57
+ side: SwipeSide | undefined,
58
+ defaultSide: (() => SwipeSide | null) | undefined
59
+ ): SwipeSide | null | undefined {
60
+ if (!defaultSide) return side
61
+ const named = side ?? defaultSide()
62
+ return named ? mirror(named) : null
63
+ }
64
+
65
+ /** Like the native default: the right side if it is enabled, else the left side. */
66
+ function defaultOpenSide(leftWidth: number, rightWidth: number): SwipeSide | null {
67
+ if (rightWidth > 0) return 'right'
68
+ return leftWidth > 0 ? 'left' : null
69
+ }
70
+
71
+ function openNative(key: string, side: SwipeSide | null | undefined) {
72
+ if (side === undefined) openByKey(key)
73
+ else if (side) openByKeyOnSide(key, side)
74
+ }
75
+
49
76
  const Swipeable = forwardRef<SwipeableMethods, SwipeableComponentProps>(function Swipeable(
50
77
  {
51
78
  children,
@@ -53,6 +80,7 @@ const Swipeable = forwardRef<SwipeableMethods, SwipeableComponentProps>(function
53
80
  leftActionsWidth,
54
81
  rightActions,
55
82
  rightActionsWidth,
83
+ isRTL = false,
56
84
  onLeftSwipeEnd,
57
85
  onRightSwipeEnd,
58
86
  appearance = 'default',
@@ -75,7 +103,7 @@ const Swipeable = forwardRef<SwipeableMethods, SwipeableComponentProps>(function
75
103
  ref
76
104
  ) {
77
105
  const nativeRef = useRef<NativeSwipeableRef>(null)
78
- const resolved = useMemo(
106
+ const named = useMemo(
79
107
  () =>
80
108
  resolveSwipeableActions({
81
109
  leftActions,
@@ -85,6 +113,29 @@ const Swipeable = forwardRef<SwipeableMethods, SwipeableComponentProps>(function
85
113
  }),
86
114
  [leftActions, leftActionsWidth, rightActions, rightActionsWidth]
87
115
  )
116
+ // From here on `resolved` holds the native, physical sides.
117
+ const resolved = useMemo(
118
+ () => (isRTL ? { ...named, left: named.right, right: named.left } : named),
119
+ [isRTL, named]
120
+ )
121
+ const insetProps = useMemo(() => {
122
+ if (!gestureInsets) return null
123
+ if (!isRTL) return { gestureInsets }
124
+ const { left, right, ...vertical } = gestureInsets
125
+ return {
126
+ gestureInsets: {
127
+ ...vertical,
128
+ ...(right !== undefined ? { left: right } : {}),
129
+ ...(left !== undefined ? { right: left } : {})
130
+ }
131
+ }
132
+ }, [gestureInsets, isRTL])
133
+ // The ref handle and the static registry outlive a render, so they read through refs.
134
+ const isRTLRef = useRef(isRTL)
135
+ isRTLRef.current = isRTL
136
+ const defaultSideRef = useRef<SwipeSide | null>(null)
137
+ defaultSideRef.current = defaultOpenSide(named.left.width, named.right.width)
138
+ const readDefaultSide = useCallback(() => defaultSideRef.current, [])
88
139
 
89
140
  // Normalize recyclingKey before hooks that depend on it
90
141
  const normalizedKey = normalizeRecyclingKey(recyclingKey)
@@ -113,6 +164,15 @@ const Swipeable = forwardRef<SwipeableMethods, SwipeableComponentProps>(function
113
164
  swipeStartedRef.current = false
114
165
  }, [initialSides, normalizedKey])
115
166
 
167
+ // A layout effect, so a static command from any passive mount effect sees the row.
168
+ useLayoutEffect(() => {
169
+ if (!isRTL || !normalizedKey) return
170
+ mirroredRows.set(normalizedKey, readDefaultSide)
171
+ return () => {
172
+ if (mirroredRows.get(normalizedKey) === readDefaultSide) mirroredRows.delete(normalizedKey)
173
+ }
174
+ }, [isRTL, normalizedKey, readDefaultSide])
175
+
116
176
  const warningText = resolved.warnings.join('\n')
117
177
  useEffect(() => {
118
178
  if (__DEV__ && warningText) console.warn(`[Swipeable] ${warningText}`)
@@ -142,8 +202,7 @@ const Swipeable = forwardRef<SwipeableMethods, SwipeableComponentProps>(function
142
202
  open: (side?: SwipeSide) => {
143
203
  const key = recyclingKeyRef.current
144
204
  if (key) {
145
- if (side === undefined) openByKey(key)
146
- else openByKeyOnSide(key, side)
205
+ openNative(key, nativeOpenSide(side, isRTLRef.current ? readDefaultSide : undefined))
147
206
  } else if (__DEV__) {
148
207
  console.warn('[Swipeable] open() called without recyclingKey - method has no effect')
149
208
  }
@@ -161,7 +220,7 @@ const Swipeable = forwardRef<SwipeableMethods, SwipeableComponentProps>(function
161
220
  }
162
221
  }
163
222
  }),
164
- []
223
+ [readDefaultSide]
165
224
  )
166
225
 
167
226
  const handleSwipeStart = useCallback(
@@ -221,11 +280,12 @@ const Swipeable = forwardRef<SwipeableMethods, SwipeableComponentProps>(function
221
280
  if (event.nativeEvent.recyclingKey !== (normalizedKey || undefined)) return
222
281
  swipeStartedRef.current = false
223
282
  onSwipeEnd?.(event.nativeEvent.state)
224
- const side = event.nativeEvent.side
283
+ const nativeSide = event.nativeEvent.side
284
+ const side = isRTL && nativeSide ? mirror(nativeSide) : nativeSide
225
285
  if (side === 'left') onLeftSwipeEnd?.(event.nativeEvent.state)
226
286
  if (side === 'right') onRightSwipeEnd?.(event.nativeEvent.state)
227
287
  },
228
- [normalizedKey, onLeftSwipeEnd, onRightSwipeEnd, onSwipeEnd]
288
+ [isRTL, normalizedKey, onLeftSwipeEnd, onRightSwipeEnd, onSwipeEnd]
229
289
  )
230
290
 
231
291
  return (
@@ -241,7 +301,7 @@ const Swipeable = forwardRef<SwipeableMethods, SwipeableComponentProps>(function
241
301
  friction={friction}
242
302
  threshold={threshold}
243
303
  gestureEnabled={gestureEnabled}
244
- {...(gestureInsets ? { gestureInsets } : {})}
304
+ {...insetProps}
245
305
  dragOffsetFromEdge={dragOffsetFromEdge}
246
306
  autoClose={autoClose}
247
307
  autoCloseTimeout={autoCloseTimeout}
@@ -304,8 +364,7 @@ SwipeableExport.open = (recyclingKey: string, side?: SwipeSide) => {
304
364
  console.warn('[Swipeable.open] recyclingKey must be a non-empty string')
305
365
  return
306
366
  }
307
- if (side === undefined) openByKey(recyclingKey)
308
- else openByKeyOnSide(recyclingKey, side)
367
+ openNative(recyclingKey, nativeOpenSide(side, mirroredRows.get(recyclingKey)))
309
368
  }
310
369
 
311
370
  SwipeableExport.close = (recyclingKey: string, animated?: boolean) => {
@@ -82,6 +82,13 @@ export interface SwipeableCommonProps {
82
82
  friction?: number
83
83
  threshold?: number
84
84
  gestureEnabled?: boolean
85
+ /**
86
+ * Mirrors the row for a right-to-left layout. The `left` props, `open('left')` and
87
+ * `onLeftSwipeEnd` then act on the right edge, and the `right` ones on the left edge.
88
+ * The `left` and `right` values of `gestureInsets` swap too.
89
+ * Defaults to `false`: the sides are physical edges in every layout direction.
90
+ */
91
+ isRTL?: boolean
85
92
  /**
86
93
  * Edge bands where a touch does not start a swipe. The children handle that touch,
87
94
  * for example a horizontal pager. Applies while the row is closed and at rest.
@@ -102,7 +109,7 @@ export interface SwipeableCommonProps {
102
109
 
103
110
  export interface SwipeableMethods {
104
111
  close: (animated?: boolean) => void
105
- /** Open the requested physical edge; without a side, prefer enabled right, then left. */
112
+ /** Open the requested side; without a side, prefer enabled right, then left. */
106
113
  open: (side?: SwipeSide) => void
107
114
  cancel: () => void
108
115
  }
@@ -114,19 +121,25 @@ export interface SwipeableStatic {
114
121
  closeAll: (animated?: boolean) => void
115
122
  }
116
123
 
124
+ // A width enables its side. Content is optional: without it the rail is empty.
117
125
  type LeftActionsConfiguration =
118
- | { leftActions: ReactNode; leftActionsWidth: number }
126
+ | { leftActions?: ReactNode; leftActionsWidth: number }
119
127
  | { leftActions?: null | false | undefined; leftActionsWidth?: never }
120
128
 
121
129
  type RightActionsConfiguration =
122
- | { rightActions: ReactNode; rightActionsWidth: number }
130
+ | { rightActions?: ReactNode; rightActionsWidth: number }
123
131
  | { rightActions?: null | false | undefined; rightActionsWidth?: never }
124
132
 
125
- /** The sole action API: explicit physical-edge pairs, including single-sided rows. */
133
+ /** The sole action API: explicit side pairs, physical edges unless `isRTL` mirrors them. */
126
134
  export type SwipeableProps = SwipeableCommonProps &
127
135
  LeftActionsConfiguration &
128
136
  RightActionsConfiguration &
129
- ({ leftActions: ReactNode } | { rightActions: ReactNode })
137
+ (
138
+ | { leftActions: ReactNode }
139
+ | { rightActions: ReactNode }
140
+ | { leftActionsWidth: number }
141
+ | { rightActionsWidth: number }
142
+ )
130
143
 
131
144
  /** Descriptive alias for the same explicit-side API, not a separate implementation. */
132
145
  export type TwoSidedSwipeableProps = SwipeableProps
@@ -20,14 +20,13 @@ const isWidth = (width: number | undefined): width is number =>
20
20
  export function resolveSwipeableActions(input: ActionsInput) {
21
21
  const warnings: string[] = []
22
22
  const resolve = (side: SwipeSide, node: ReactNode, width?: number): ResolvedActions => {
23
+ // null and false turn a side off. undefined leaves the width in charge: an empty rail.
24
+ if (node !== undefined && !isContent(node)) return { node: null, width: 0 }
25
+ if (isWidth(width)) return { node: node ?? null, width }
23
26
  if (node !== undefined) {
24
- if (!isContent(node)) return { node: null, width: 0 }
25
- if (isWidth(width)) return { node, width }
26
27
  warnings.push(side + 'Actions requires a finite, positive ' + side + 'ActionsWidth.')
27
- return { node: null, width: 0 }
28
- }
29
- if (width !== undefined) {
30
- warnings.push(side + 'ActionsWidth is ignored without explicit ' + side + 'Actions.')
28
+ } else if (width !== undefined) {
29
+ warnings.push(`${side}ActionsWidth must be finite and positive.`)
31
30
  }
32
31
  return { node: null, width: 0 }
33
32
  }