You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This component acts as a cross-platform replacement for React Native's [`DrawerLayoutAndroid`](http://reactnative.dev/docs/drawerlayoutandroid.html) component, written using [Reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started). For detailed information on standard parameters, please refer to the [React Native documentation](http://reactnative.dev/docs/drawerlayoutandroid.html).
13
15
:::
@@ -29,16 +31,101 @@ drawerType?: DrawerType;
29
31
Specifies the way the drawer will be displayed.
30
32
Accepts values of the `DrawerType` enum. Defaults to `FRONT`.
31
33
32
-
|`drawerType`| Description |
33
-
| -- | -- |
34
-
|`FRONT`| The drawer will be displayed above the content view. |
35
-
|`BACK`| The drawer will be displayed below the content view, revealed by sliding away the content view. |
36
-
|`SLIDE`| The drawer will appear attached to the content view, opening it slides both the drawer and the content view. |
34
+
-`FRONT` The drawer will be displayed above the content view.
35
+
-`BACK` The drawer will be displayed below the content view, revealed by sliding away the content view.
36
+
-`SLIDE` The drawer will appear attached to the content view, opening it slides both the drawer and the content view.
Either a component rendered in the content view or a function. If `children` is a function, it receives an `openValue` parameter - [`SharedValue`](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#shared-value) that indicates the progress of the drawer's opening or closing animation. This value equals `0` when the drawer is closed and `1` when it is fully opened. The drawer component can use this value to animate its children during the opening or closing process. This function must return a [`ReactNode`](https://reactnative.dev/docs/react-node).
Allows users to choose which mouse button should handler respond to. Arguments can be combined using `|` operator, e.g. `mouseButton(MouseButton.LEFT | MouseButton.RIGHT)`. Default value is set to `MouseButton.LEFT`.
243
+
<MouseButtonProp />
178
244
179
245
<HeaderWithBadgesplatforms={['web']}>
180
246
### enableContextMenu
@@ -186,8 +252,27 @@ enableContextMenu: boolean;
186
252
187
253
Specifies whether context menu should be enabled after clicking on underlying view with right mouse button. Default value is set to `false` if [`MouseButton.RIGHT`](#mousebutton-web--android-only) is specified.
188
254
255
+
<HeaderWithBadgesplatforms={['web']}>
256
+
### userSelect
257
+
</HeaderWithBadges>
258
+
259
+
```ts
260
+
userSelect: 'none'|'auto'|'text';
261
+
```
262
+
263
+
This parameter allows to specify which `userSelect` property should be applied to underlying view. Default value is set to `"none"`.
264
+
265
+
<HeaderWithBadgesplatforms={['web']}>
266
+
### activeCursor
267
+
</HeaderWithBadges>
268
+
269
+
```ts
270
+
activeCursor: ActiveCursor;
271
+
```
272
+
273
+
This parameter allows to specify which cursor should be used when gesture activates. Supports all [CSS cursor values](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/cursor#keyword) (e.g. `"grab"`, `"zoom-in"`). Default value is set to `"auto"`.
189
274
190
-
## Methods
275
+
## Drawer ref methods
191
276
192
277
Using a reference to `ReanimatedDrawerLayout` allows you to manually trigger the opening and closing of the component.
Enables two-finger gestures on supported devices, for example iPads with trackpads. If not enabled the gesture will require click + drag, with `enableTrackpadTwoFingerGesture` swiping with two fingers will also trigger the gesture.
Allows users to choose which mouse button should handler respond to. Arguments can be combined using `|` operator, e.g. `mouseButton(MouseButton.LEFT | MouseButton.RIGHT)`. Default value is set to `MouseButton.LEFT`.
261
+
Indicates whether `ReanimatedSwipeable`should be analyzing stream of touch events or not. Defaults to `true`.
277
262
278
-
<HeaderWithBadgesplatforms={['web']}>
279
-
### enableContextMenu
280
-
</HeaderWithBadges>
263
+
### testID
281
264
282
265
```ts
283
-
enableContextMenu: boolean;
266
+
testID: string;
284
267
```
285
268
286
-
Specifies whether context menu should be enabled after clicking on underlying view with right mouse button. Default value is set to `false`.
269
+
Sets a `testID` property, allowing for querying `ReanimatedSwipeable` for it in tests.
Copy file name to clipboardExpand all lines: packages/docs-gesture-handler/docs/gestures/_shared/base-gesture-config.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,9 @@ useAnimated: boolean;
139
139
140
140
Setting this property is set to `true` ensures that the [Animated API](/docs/fundamentals/animated-interactions) functions correctly when `useNativeDriver` is set to `false`. The default value is set to `false`.
Allows users to choose which mouse buttons to respond to. Arguments can be combined using `|` operator, e.g. `mouseButton(MouseButton.LEFT | MouseButton.RIGHT)`. Default value is set to `MouseButton.LEFT`.
Allows users to choose which mouse button should handler respond to. Arguments can be combined using `|` operator, e.g. `mouseButton(MouseButton.LEFT | MouseButton.RIGHT)`. Default value is set to `MouseButton.LEFT`.
@@ -75,29 +77,7 @@ maxDistance: number | SharedValue<number>;
75
77
76
78
Maximum distance, expressed in points, that defines how far the finger is allowed to travel during a long press gesture. If the finger travels further than the defined distance and the gesture hasn't yet activated, it will fail to recognize the gesture. The default value is 10.
Allows users to choose which mouse button should handler respond to. Arguments can be combined using `|` operator, e.g. `mouseButton(MouseButton.LEFT | MouseButton.RIGHT)`. Default value is set to `MouseButton.LEFT`.
0 commit comments