Skip to content

Commit 9933009

Browse files
authored
docs: creating a getting started page document (#57)
1 parent 3764972 commit 9933009

File tree

17 files changed

+258
-432
lines changed

17 files changed

+258
-432
lines changed

docs/docs/en/_nav.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"text": "Guide",
4-
"link": "/guide/",
5-
"activeMatch": "/guide/"
4+
"link": "/guide/getting-started/overview/",
5+
"activeMatch": "/guide/getting-started/"
66
}
77
]

docs/docs/en/guide/_meta.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
["index"]
1+
[
2+
{
3+
"type": "dir",
4+
"name": "getting-started",
5+
"label": "Getting Started"
6+
}
7+
]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
"overview",
3+
"installation"
4+
]
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { Steps, PackageManagerTabs } from '@theme';
2+
3+
# Installation
4+
5+
:::info Important
6+
`react-native-gesture-image-viewer` is a high-performance viewer library built on [`react-native-reanimated`](https://www.npmjs.com/package/react-native-reanimated) and [`react-native-gesture-handler`](https://www.npmjs.com/package/react-native-gesture-handler).
7+
Therefore, you **must install** React Native Reanimated and Gesture Handler before using this library. Please refer to the official documentation of these libraries for detailed setup guides.
8+
:::
9+
10+
#### Minimum Requirements
11+
12+
|Library|Minimum Version|
13+
|:--|:--:|
14+
|`react`|`>=18.0.0`|
15+
|`react-native`|`>=0.75.0`|
16+
|`react-native-gesture-handler`|`>=2.24.0`|
17+
|`react-native-reanimated`|`>=3.0.0`|
18+
19+
## [React Native Reanimated Setup](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/)
20+
21+
<PackageManagerTabs command="install react-native-reanimated" />
22+
23+
<Steps>
24+
25+
### Add the plugin to your `babel.config.js`:
26+
27+
```js title="babel.config.js"
28+
module.exports = {
29+
presets: [
30+
... // don't add it here :)
31+
],
32+
plugins: [
33+
...
34+
// for web
35+
'@babel/plugin-proposal-export-namespace-from', // [!code highlight]
36+
// react-native-reanimated/plugin has to be listed last.
37+
'react-native-reanimated/plugin', // [!code highlight]
38+
],
39+
};
40+
```
41+
42+
### Wrap your Metro config with `wrapWithReanimatedMetroConfig` in `metro.config.js`:
43+
44+
```js title="metro.config.js"
45+
// [!code highlight:3]
46+
const {
47+
wrapWithReanimatedMetroConfig,
48+
} = require('react-native-reanimated/metro-config');
49+
50+
const config = {
51+
// Your existing Metro configuration options
52+
};
53+
54+
module.exports = wrapWithReanimatedMetroConfig(config); // [!code highlight]
55+
```
56+
57+
</Steps>
58+
59+
## [React Native Gesture Handler Setup](https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/installation)
60+
61+
<PackageManagerTabs command="install react-native-gesture-handler" />
62+
63+
- `react-native-gesture-handler` generally doesn't require additional setup, but please refer to the official documentation for your specific environment.
64+
- For [using gestures in Android modals](https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/installation#android), you would normally need to wrap modal content with `GestureHandlerRootView`. However, **this library already includes `GestureHandlerRootView` internally, so no additional wrapping is needed when using modals.**
65+
66+
## Install React Native Gesture Image Viewer
67+
68+
You’re all set! 🎉
69+
Start by installing `react-native-gesture-image-viewer`
70+
71+
<PackageManagerTabs command="install react-native-gesture-image-viewer" />
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Overview
2+
3+
<div style={{ width: '100%', alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
4+
<img src="https://raw.githubusercontent.com/saseungmin/react-native-gesture-image-viewer/main/assets/example.gif" width="600" alt="Demo of react-native-gesture-image-viewer gestures" />
5+
</div>
6+
7+
Have you ever struggled with implementing complex gesture handling and animations when building image galleries or content viewers in React Native?
8+
9+
Existing libraries often have limited customization options or performance issues. `react-native-gesture-image-viewer` is a high-performance **universal gesture viewer** library built on [**React Native Reanimated**](https://docs.swmansion.com/react-native-reanimated/) and [**Gesture Handler**](https://docs.swmansion.com/react-native-gesture-handler/docs/), providing complete customization and intuitive gesture support for not only images but also videos, custom components, and any other content.
10+
11+
## Key Features
12+
13+
- 🤌 **Complete Gesture Support** - Pinch zoom, double-tap zoom, swipe navigation, pan when zoomed-in, and vertical drag to dismiss
14+
- 🏎️ **High-Performance Animations** - Smooth and responsive animations at 60fps and beyond, powered by React Native Reanimated
15+
- 🎨 **Full Customization** - Total control over components, styles, and gesture behavior
16+
- 🎛️ **External Control API** - Trigger actions programmatically from buttons or other UI components
17+
- 🧩 **Multi-Instance Management** - Manage multiple viewers independently using unique IDs
18+
- 🧬 **Flexible Integration** - Use with Modal, [React Native Modal](https://www.npmjs.com/package/react-native-modal), ScrollView, FlatList, [FlashList](https://www.npmjs.com/package/@shopify/flash-list), [Expo Image](https://www.npmjs.com/package/expo-image), [FastImage](https://github.com/DylanVann/react-native-fast-image), and more
19+
- 🧠 **Full TypeScript Support** - Great developer experience with type inference and safety
20+
- 🌐 **Cross-Platform Support** - Runs on iOS, Android, and Web with Expo Go and New Architecture compatibility
21+
- 🪄 **Easy-to-Use API** - Simple and intuitive API that requires minimal setup

docs/docs/en/guide/index.mdx

Lines changed: 0 additions & 210 deletions
This file was deleted.

docs/docs/en/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ hero:
88
actions:
99
- theme: brand
1010
text: Quick Start
11-
link: /guide/
11+
link: /guide/getting-started/overview/
1212
- theme: alt
1313
text: GitHub
1414
link: https://github.com/saseungmin/react-native-gesture-image-viewer

docs/docs/ko/_nav.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"text": "가이드",
4-
"link": "/guide/",
5-
"activeMatch": "/guide/"
4+
"link": "/guide/getting-started/overview/",
5+
"activeMatch": "/guide/getting-started/"
66
}
77
]

docs/docs/ko/guide/_meta.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
["index"]
1+
[
2+
{
3+
"type": "dir",
4+
"name": "getting-started",
5+
"label": "시작하기"
6+
}
7+
]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
"overview",
3+
"installation"
4+
]

0 commit comments

Comments
 (0)