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

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 +263 -0
  2. package/package.json +4 -3
package/README.md CHANGED
@@ -0,0 +1,263 @@
1
+ # ๐Ÿ“˜ **react-native-tuto-showcase**
2
+
3
+ ### ๐Ÿ”ฆ A fully customizable Spotlight / Tutorial / Coachmark overlay for React Native
4
+
5
+ Perfect for onboarding flows, feature tours, highlighting UI elements, and guiding users interactively.
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
+ />
26
+
27
+ ---
28
+
29
+ # โœจ Features
30
+
31
+ * ๐ŸŽฏ Highlight any UI element using **circle or rounded-rectangle spotlight**
32
+
33
+ * ๐Ÿ“ 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
+
52
+ * โšก Supports React Native 0.72+
53
+
54
+ ---
55
+
56
+ # ๐Ÿ“ฆ Installation
57
+
58
+ ```sh
59
+ npm install react-native-tuto-showcase
60
+ # or
61
+ yarn add react-native-tuto-showcase
62
+ ```
63
+
64
+ > Make sure you have `react-native-svg` installed (auto-installed as dependency).
65
+
66
+ ---
67
+
68
+ # ๐Ÿš€ Usage Example
69
+
70
+ ### **Highlight a component inside your screen**
71
+
72
+ ```tsx
73
+ import React, { useRef } from 'react';
74
+ import { View, Text, Pressable } from 'react-native';
75
+ import TutoShowcase, { TutoShowcaseHandle } from 'react-native-tuto-showcase';
76
+
77
+ export default function HomeScreen() {
78
+ const tutoRef = useRef<TutoShowcaseHandle>(null);
79
+ const boxRef = useRef<View>(null);
80
+
81
+ return (
82
+ <>
83
+ <TutoShowcase
84
+ ref={tutoRef}
85
+ title={<Text style={{ color: '#fff', fontSize: 22 }}>ุชุฑุชูŠุจ ุงู„ุฃู‚ุณุงู…</Text>}
86
+ description={
87
+ 'ูŠู…ูƒู†ูƒ ุณุญุจ ู‡ุฐุง ุงู„ู‚ุณู… ู„ุฃุนู„ู‰ ุฃูˆ ู„ุฃุณูู„ ู„ุชุบูŠูŠุฑ ุชุฑุชูŠุจู‡ ููŠ ุงู„ุตูุญุฉ.\n' +
88
+ 'ุณูŠุชู… ุญูุธ ุงู„ุชุฑุชูŠุจ ุงู„ุฌุฏูŠุฏ ุชู„ู‚ุงุฆูŠู‹ุง.'
89
+ }
90
+ buttonText="ุชู…ุงู…"
91
+ overlayBackgroundColor="rgba(0,0,0,0.85)"
92
+ buttonContainerStyle={{ backgroundColor: '#ff9800' }}
93
+ buttonTextStyle={{ color: '#000', fontWeight: 'bold' }}
94
+ />
95
+
96
+ <View ref={boxRef} style={{ marginTop: 100, backgroundColor: '#eee', padding: 20 }}>
97
+ <Text>Drag Me</Text>
98
+ </View>
99
+
100
+ <Pressable
101
+ onPress={() => {
102
+ tutoRef.current
103
+ ?.on(boxRef)
104
+ .addRoundRect()
105
+ .withBorder()
106
+ .showOnce('highlight-box');
107
+ }}>
108
+ <Text>Start Tutorial</Text>
109
+ </Pressable>
110
+ </>
111
+ );
112
+ }
113
+ ```
114
+
115
+ ---
116
+
117
+ # ๐Ÿงฉ API Documentation
118
+
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 |
131
+
132
+ ---
133
+
134
+ # ๐ŸŽ› Ref API (Controller)
135
+
136
+ Returned via:
137
+
138
+ ```ts
139
+ const tutoRef = useRef<TutoShowcaseHandle>(null);
140
+ ```
141
+
142
+ Then:
143
+
144
+ ```ts
145
+ tutoRef.current?.on(targetRef)
146
+ ```
147
+
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
169
+
170
+ ```tsx
171
+ <TutoShowcase
172
+ ref={tutoRef}
173
+ lottie={
174
+ <LottieView
175
+ source={require('./hand.json')}
176
+ style={{ width: 120, height: 120 }}
177
+ autoPlay
178
+ loop
179
+ />
180
+ }
181
+ />
182
+ ```
183
+
184
+ Lottie will automatically be positioned above the target highlight.
185
+
186
+ ---
187
+
188
+ # ๐ŸŽจ Customizing Button Style
189
+
190
+ ```tsx
191
+ <TutoShowcase
192
+ buttonContainerStyle={{
193
+ backgroundColor: '#FFD700',
194
+ paddingVertical: 10,
195
+ borderRadius: 8,
196
+ }}
197
+ buttonTextStyle={{
198
+ color: '#000',
199
+ fontWeight: 'bold',
200
+ }}
201
+ />
202
+ ```
203
+
204
+ ---
205
+
206
+ # โš™ Spotlight Shape Options
207
+
208
+ ### Circle Spotlight
209
+
210
+ ```ts
211
+ .on(ref)
212
+ .addCircle(1.2) // ratio
213
+ .show()
214
+ ```
215
+
216
+ ### Rounded Rectangle Spotlight
217
+
218
+ ```ts
219
+ .on(ref)
220
+ .addRoundRect(1.1, 20, { pad: 30, dx: 0, dy: 0 })
221
+ .show()
222
+ ```
223
+
224
+ ---
225
+
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
240
+
241
+ Bundled `.d.ts` typings included automatically:
242
+
243
+ ```ts
244
+ import type { TutoShowcaseHandle } from 'react-native-tuto-showcase';
245
+ ```
246
+
247
+ ---
248
+
249
+ # ๐Ÿ“ Important Notes
250
+
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
255
+
256
+ ---
257
+
258
+ # ๐Ÿ“ License
259
+
260
+ MIT ยฉ **Ahmed Mohamed Ali Ali Hegazy**
261
+
262
+ ---
263
+
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "react-native-tuto-showcase",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
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",
7
7
  "source": "src/index.tsx",
8
- "files": ["dist"],
8
+ "files": [
9
+ "dist"
10
+ ],
9
11
  "scripts": {
10
12
  "build": "tsc"
11
13
  },
@@ -34,5 +36,4 @@
34
36
  "@types/react-native": "^0.72.8",
35
37
  "typescript": "^5.9.3"
36
38
  }
37
-
38
39
  }