react-native-tuto-showcase 1.0.2 โ†’ 1.0.4

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.
Files changed (2) hide show
  1. package/README.md +107 -138
  2. package/package.json +5 -1
package/README.md CHANGED
@@ -4,51 +4,30 @@
4
4
 
5
5
  Perfect for onboarding flows, feature tours, highlighting UI elements, and guiding users interactively.
6
6
 
7
- ---
8
-
9
- # ๐Ÿ“ฝ Demo
10
-
11
- ### **iOS Showcase**
12
-
13
- <img
14
- src="https://raw.githubusercontent.com/ahmedhegazydev/react-native-tuto-showcase/master/src/assets/SimulatorScreenRecording-iPhone16Pro-2025-11-24at14.14.46online-video-cutter.com-ezgif.com-video-to-gif-converter.gif"
15
- width="350"
16
- />
17
-
18
- ---
19
-
20
- ### **Android Showcase**
21
-
22
- <img
23
- src="https://raw.githubusercontent.com/ahmedhegazydev/react-native-tuto-showcase/master/src/assets/ScreenRecording2025-12-02at7.52.23PMonline-video-cutter.com-ezgif.com-video-to-gif-converter.gif"
24
- width="350"
25
- />
7
+ Now with **full-screen Lottie placement** + **custom offsets**.
26
8
 
27
9
  ---
28
10
 
29
11
  # โœจ Features
30
12
 
31
- * ๐ŸŽฏ Highlight any UI element using **circle or rounded-rectangle spotlight**
32
-
13
+ * ๐ŸŽฏ Highlight any UI element with **Circle / RoundRect** spotlight
33
14
  * ๐Ÿ“ Auto-calculated spotlight position using `measureInWindow`
34
-
35
- * ๐Ÿ” Show once / persistent keys using AsyncStorage
36
-
37
- * ๐ŸŽž Lottie animation support above target
38
-
39
- * ๐Ÿ•ณ Multiple shapes per screen (multi-step tutorial)
40
-
41
- * โœ‹ Gesture hints (swipe left/right, scroll)
42
-
43
- * ๐ŸŽจ Customizable:
44
-
45
- * Overlay background color
46
- * Button text, color, style
47
- * Title & description
48
- * Lottie size & position
49
-
50
- * ๐Ÿ“ฑ Works on both **iOS & Android**
51
-
15
+ * ๐Ÿ” Show-once logic (AsyncStorage)
16
+ * ๐ŸŽž **Lottie Animations with full-screen positioning**
17
+
18
+ * `top-left`, `top-right`, `top-center`
19
+ * `bottom-left`, `bottom-right`, `bottom-center`
20
+ * `center`
21
+ * * `lottieOffset={{dx, dy}}`
22
+ * ๐Ÿ“ฆ Multiple spots on one screen
23
+ * โœ‹ Gesture hints (swipe / scroll)
24
+ * ๐ŸŽจ Fully customizable:
25
+
26
+ * Colors
27
+ * Button style
28
+ * Fonts
29
+ * Overlay background
30
+ * ๐Ÿ“ฑ Works on **iOS & Android**
52
31
  * โšก Supports React Native 0.72+
53
32
 
54
33
  ---
@@ -61,20 +40,16 @@ npm install react-native-tuto-showcase
61
40
  yarn add react-native-tuto-showcase
62
41
  ```
63
42
 
64
- > Make sure you have `react-native-svg` installed (auto-installed as dependency).
65
-
66
43
  ---
67
44
 
68
- # ๐Ÿš€ Usage Example
69
-
70
- ### **Highlight a component inside your screen**
45
+ # ๐Ÿš€ Basic Usage
71
46
 
72
47
  ```tsx
73
48
  import React, { useRef } from 'react';
74
49
  import { View, Text, Pressable } from 'react-native';
75
50
  import TutoShowcase, { TutoShowcaseHandle } from 'react-native-tuto-showcase';
76
51
 
77
- export default function HomeScreen() {
52
+ export default function Home() {
78
53
  const tutoRef = useRef<TutoShowcaseHandle>(null);
79
54
  const boxRef = useRef<View>(null);
80
55
 
@@ -84,27 +59,25 @@ export default function HomeScreen() {
84
59
  ref={tutoRef}
85
60
  title={<Text style={{ color: '#fff', fontSize: 22 }}>ุชุฑุชูŠุจ ุงู„ุฃู‚ุณุงู…</Text>}
86
61
  description={
87
- 'ูŠู…ูƒู†ูƒ ุณุญุจ ู‡ุฐุง ุงู„ู‚ุณู… ู„ุฃุนู„ู‰ ุฃูˆ ู„ุฃุณูู„ ู„ุชุบูŠูŠุฑ ุชุฑุชูŠุจู‡ ููŠ ุงู„ุตูุญุฉ.\n' +
88
- 'ุณูŠุชู… ุญูุธ ุงู„ุชุฑุชูŠุจ ุงู„ุฌุฏูŠุฏ ุชู„ู‚ุงุฆูŠู‹ุง.'
62
+ 'ูŠู…ูƒู†ูƒ ุณุญุจ ู‡ุฐุง ุงู„ู‚ุณู… ู„ุฃุนู„ู‰ ุฃูˆ ู„ุฃุณูู„ ู„ุชุบูŠูŠุฑ ุชุฑุชูŠุจู‡.\n' +
63
+ 'ุณูŠุชู… ุญูุธ ุงู„ุชุฑุชูŠุจ ุชู„ู‚ุงุฆูŠู‹ุง.'
89
64
  }
90
65
  buttonText="ุชู…ุงู…"
91
- overlayBackgroundColor="rgba(0,0,0,0.85)"
92
- buttonContainerStyle={{ backgroundColor: '#ff9800' }}
93
- buttonTextStyle={{ color: '#000', fontWeight: 'bold' }}
94
66
  />
95
67
 
96
- <View ref={boxRef} style={{ marginTop: 100, backgroundColor: '#eee', padding: 20 }}>
68
+ <View ref={boxRef} style={{ marginTop: 120, padding: 20, backgroundColor: '#eee' }}>
97
69
  <Text>Drag Me</Text>
98
70
  </View>
99
71
 
100
72
  <Pressable
101
- onPress={() => {
73
+ onPress={() =>
102
74
  tutoRef.current
103
75
  ?.on(boxRef)
104
76
  .addRoundRect()
105
77
  .withBorder()
106
- .showOnce('highlight-box');
107
- }}>
78
+ .showOnce('highlight-box')
79
+ }
80
+ >
108
81
  <Text>Start Tutorial</Text>
109
82
  </Pressable>
110
83
  </>
@@ -114,58 +87,25 @@ export default function HomeScreen() {
114
87
 
115
88
  ---
116
89
 
117
- # ๐Ÿงฉ API Documentation
90
+ # ๐ŸŽž Lottie Placement (New)
118
91
 
119
- ## `<TutoShowcase />` Props
120
-
121
- | Prop | Type | Default | Description |
122
- | ------------------------ | --------------------- | ------------------ | ---------------------------------- |
123
- | `title` | `ReactNode` | โ€” | Title element (supports JSX & RTL) |
124
- | `description` | `string \| ReactNode` | โ€” | Description text |
125
- | `buttonText` | `string` | `"GOT IT"` | CTA button label |
126
- | `buttonTextStyle` | `TextStyle` | โ€” | Custom style for CTA text |
127
- | `buttonContainerStyle` | `ViewStyle` | โ€” | Custom style for CTA container |
128
- | `overlayBackgroundColor` | `string` | `rgba(0,0,0,0.78)` | Background dim color |
129
- | `onGotIt` | `() => void` | โ€” | Called when user presses CTA |
130
- | `lottie` | `ReactElement` | โ€” | Lottie animation above target |
92
+ The Lottie animation is now positioned **relative to the full screen**, not the spotlight.
131
93
 
132
94
  ---
133
95
 
134
- # ๐ŸŽ› Ref API (Controller)
135
-
136
- Returned via:
96
+ ## ๐Ÿ”น Available placements
137
97
 
138
- ```ts
139
- const tutoRef = useRef<TutoShowcaseHandle>(null);
140
98
  ```
141
-
142
- Then:
143
-
144
- ```ts
145
- tutoRef.current?.on(targetRef)
99
+ top-left
100
+ top-center
101
+ top-right
102
+ bottom-left
103
+ bottom-center
104
+ bottom-right
105
+ center
146
106
  ```
147
107
 
148
- ### Methods
149
-
150
- | Method | Description |
151
- | -------------------------------------- | -------------------------------------------- |
152
- | `on(ref)` | Select target element |
153
- | `show()` | Show the spotlight |
154
- | `dismiss()` | Hide the overlay |
155
- | `addCircle(ratio?)` | Add circle spotlight |
156
- | `addRoundRect(ratio?, radius?, opts?)` | Add rounded-rect spotlight |
157
- | `displaySwipableLeft()` | Show left gesture hint |
158
- | `displaySwipableRight()` | Show right gesture hint |
159
- | `displayScrollable()` | Show scroll gesture hint |
160
- | `withBorder()` | Add border around spotlight |
161
- | `onClick(cb)` | Make spotlight clickable |
162
- | `showOnce(key)` | Show once only (persistent via AsyncStorage) |
163
- | `resetShowOnce(key)` | Clear โ€œshow onceโ€ key |
164
- | `isShowOnce(key)` | Check stored key |
165
-
166
- ---
167
-
168
- # ๐ŸŽฌ Lottie Support
108
+ ## ๐Ÿ”น Example
169
109
 
170
110
  ```tsx
171
111
  <TutoShowcase
@@ -174,25 +114,75 @@ tutoRef.current?.on(targetRef)
174
114
  <LottieView
175
115
  source={require('./hand.json')}
176
116
  style={{ width: 120, height: 120 }}
177
- autoPlay
178
- loop
179
117
  />
180
118
  }
119
+ lottiePlacement="top-right"
120
+ lottieOffset={{ dx: -20, dy: 10 }}
181
121
  />
182
122
  ```
183
123
 
184
- Lottie will automatically be positioned above the target highlight.
124
+ ---
125
+
126
+ # ๐Ÿงฉ Props
127
+
128
+ ## `<TutoShowcase />`
129
+
130
+ | Prop | Type | Default | Description |
131
+ | ------------------------ | ------------------------------ | ------------------ | ----------------------- |
132
+ | `title` | `ReactNode` | โ€” | Title JSX |
133
+ | `description` | `string \| ReactNode` | โ€” | Description text |
134
+ | `buttonText` | `string` | `"GOT IT"` | CTA label |
135
+ | `buttonTextStyle` | `TextStyle` | โ€” | Style for CTA text |
136
+ | `buttonContainerStyle` | `ViewStyle` | โ€” | Style for CTA button |
137
+ | `overlayBackgroundColor` | `string` | `rgba(0,0,0,0.78)` | Dim overlay color |
138
+ | `onGotIt` | `() => void` | โ€” | Called when CTA pressed |
139
+ | `lottie` | `ReactElement` | โ€” | Lottie animation |
140
+ | **`lottiePlacement`** | `"top-left" \| ...` | `"top-center"` | โญ Full-screen placement |
141
+ | **`lottieOffset`** | `{ dx?: number; dy?: number }` | `{}` | Extra offset |
185
142
 
186
143
  ---
187
144
 
188
- # ๐ŸŽจ Customizing Button Style
145
+ # ๐ŸŽ› Ref API
146
+
147
+ ```ts
148
+ const tutoRef = useRef<TutoShowcaseHandle>(null);
149
+ ```
150
+
151
+ | Method | Description |
152
+ | -------------------------------------- | ----------------------------- |
153
+ | `on(ref)` | Select target element |
154
+ | `addCircle(ratio?)` | Add circle spotlight |
155
+ | `addRoundRect(ratio?, radius?, opts?)` | Add rounded spotlight |
156
+ | `withBorder()` | Add border |
157
+ | `displaySwipableLeft()` | Gesture hint |
158
+ | `displaySwipableRight()` | Gesture hint |
159
+ | `displayScrollable()` | Gesture hint |
160
+ | `onClick(cb)` | Capture taps inside spotlight |
161
+ | `show()` | Show spotlight immediately |
162
+ | `showOnce(key)` | Show once (AsyncStorage) |
163
+ | `resetShowOnce(key)` | Clear stored key |
164
+ | `isShowOnce(key)` | Check if key shown |
165
+
166
+ ---
167
+
168
+ # ๐Ÿ—‚ Show Once Logic
169
+
170
+ ```tsx
171
+ tutoRef.current
172
+ ?.on(boxRef)
173
+ .addCircle()
174
+ .showOnce('first-time');
175
+ ```
176
+
177
+ ---
178
+
179
+ # ๐ŸŽจ Button Customization
189
180
 
190
181
  ```tsx
191
182
  <TutoShowcase
192
183
  buttonContainerStyle={{
193
184
  backgroundColor: '#FFD700',
194
- paddingVertical: 10,
195
- borderRadius: 8,
185
+ borderRadius: 10,
196
186
  }}
197
187
  buttonTextStyle={{
198
188
  color: '#000',
@@ -203,55 +193,35 @@ Lottie will automatically be positioned above the target highlight.
203
193
 
204
194
  ---
205
195
 
206
- # โš™ Spotlight Shape Options
196
+ # ๐Ÿ“ Spotlight Options
207
197
 
208
- ### Circle Spotlight
198
+ ### Circle
209
199
 
210
- ```ts
200
+ ```tsx
211
201
  .on(ref)
212
- .addCircle(1.2) // ratio
202
+ .addCircle(1.3)
213
203
  .show()
214
204
  ```
215
205
 
216
- ### Rounded Rectangle Spotlight
206
+ ### Rounded Rectangle
217
207
 
218
- ```ts
208
+ ```tsx
219
209
  .on(ref)
220
- .addRoundRect(1.1, 20, { pad: 30, dx: 0, dy: 0 })
210
+ .addRoundRect(1.1, 20, { pad: 30 })
221
211
  .show()
222
212
  ```
223
213
 
224
214
  ---
225
215
 
226
- # ๐Ÿ—‚ Show Once Logic
227
-
228
- ```ts
229
- tutoRef.current
230
- ?.on(someRef)
231
- .addCircle()
232
- .showOnce('home-feature');
233
- ```
234
-
235
- Key stored automatically in AsyncStorage โ†’ wonโ€™t show again.
236
-
237
- ---
238
-
239
- # ๐Ÿ“ฆ TypeScript Support
216
+ # ๐ŸŽฅ Demo Videos
240
217
 
241
- Bundled `.d.ts` typings included automatically:
218
+ ### ๐Ÿ“ฑ iOS
242
219
 
243
- ```ts
244
- import type { TutoShowcaseHandle } from 'react-native-tuto-showcase';
245
- ```
220
+ [https://github.com/ahmedhegazydev/react-native-tuto-showcase/blob/master/src/assets/SimulatorScreenRecording-iPhone16Pro-2025-11-24at14.14.46online-video-cutter.com-ezgif.com-video-to-gif-converter.gif](https://github.com/ahmedhegazydev/react-native-tuto-showcase/blob/master/src/assets/SimulatorScreenRecording-iPhone16Pro-2025-11-24at14.14.46online-video-cutter.com-ezgif.com-video-to-gif-converter.gif)
246
221
 
247
- ---
248
-
249
- # ๐Ÿ“ Important Notes
222
+ ### ๐Ÿค– Android
250
223
 
251
- * Must wrap elements you spotlight with a `ref`
252
- * Uses `measureInWindow` โ†’ works inside ScrollView, Tabs, Modals, etc.
253
- * Overlay is drawn using **react-native-svg**
254
- * Fully RTL-compatible
224
+ [https://github.com/ahmedhegazydev/react-native-tuto-showcase/blob/master/src/assets/ScreenRecording2025-12-02at7.52.23PMonline-video-cutter.com-ezgif.com-video-to-gif-converter.gif](https://github.com/ahmedhegazydev/react-native-tuto-showcase/blob/master/src/assets/ScreenRecording2025-12-02at7.52.23PMonline-video-cutter.com-ezgif.com-video-to-gif-converter.gif)
255
225
 
256
226
  ---
257
227
 
@@ -259,5 +229,4 @@ import type { TutoShowcaseHandle } from 'react-native-tuto-showcase';
259
229
 
260
230
  MIT ยฉ **Ahmed Mohamed Ali Ali Hegazy**
261
231
 
262
- ---
263
-
232
+ ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tuto-showcase",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Customizable tutorial / spotlight overlay for React Native (onboarding, feature tours, coachmarks).",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,6 +8,10 @@
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/ahmedhegazydev/react-native-tuto-showcase.git"
14
+ },
11
15
  "scripts": {
12
16
  "build": "tsc"
13
17
  },