Gathering detailed insights and metrics for @shankulkarni/react-native-spotlight-tour
Gathering detailed insights and metrics for @shankulkarni/react-native-spotlight-tour
Gathering detailed insights and metrics for @shankulkarni/react-native-spotlight-tour
Gathering detailed insights and metrics for @shankulkarni/react-native-spotlight-tour
npm install @shankulkarni/react-native-spotlight-tour
Typescript
Module System
Node Version
NPM Version
TypeScript (75.1%)
Java (11.25%)
Objective-C (8.14%)
Starlark (3.47%)
Ruby (1.35%)
JavaScript (0.68%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
45 Commits
3 Branches
1 Contributors
Updated on Nov 18, 2021
Latest Version
0.1.17
Package Id
@shankulkarni/react-native-spotlight-tour@0.1.17
Unpacked Size
48.82 kB
Size
13.90 kB
File Count
35
NPM Version
7.24.0
Node Version
16.10.0
Published on
Jul 05, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
3
20
react-native-spotlight-tour
is a simple and intuitive library for React Native (Android and iOS
compatible). It allows you to implement a highly customizable tour feature with an awesome spotlight
effect. This library handles animations at the native level and is perfect for the following:
With npm
:
1$ npm install @stackbuilders/react-native-spotlight-tour
With yarn
:
1$ yarn add @stackbuilders/react-native-spotlight-tour
1import { AttachStep, SpotlightTourProvider, TourStep } from "@stackbuilders/react-native-spotlight-tour"; 2 3const mySteps: TourStep[] = [ 4 ... 5]; 6 7... 8 <SpotlightTourProvider steps={mySteps} overlayColor={"gray"} overlayOpacity={0.36}> 9 {({ start }) => ( 10 <> 11 <Button title="Start" onPress={start} /> 12 13 <View> 14 <AttachStep index={0}> 15 <Text>Introduction</Text> 16 </AttachStep> 17 18 <Text> 19 This is an example using the spotlight-tour library. 20 Press the Start button to see it in action. 21 </Text> 22 </View> 23 24 <View> 25 <AttachStep index={1}> 26 <TitleText>Documentation</TitleText> 27 </AttachStep> 28 <DescriptionText> 29 Please, read the documentation before installing. 30 </DescriptionText> 31 </View> 32 </> 33 )}; 34 </SpotlightTourProvider> 35 ...
The SpotlightTourProvider
allows you to wrap a section of the application to implement
the spotlight tour. In this section, you can define a component that will trigger the tour sequence.
For example, a button with an onPress
handler that will allow you to call the provided start()
method to start the tour workflow. To customize and set up this workflow, you should pass a list
of steps
to the SpotlightTourProvider
.
Check out the tour steps section for more details.
Once the tour starts, an overlay component will be shown to highlight a component from the section.
This library shows an overlay component that darkens other UI elements on the screen so that users
can focus on the children's components of AttachStep
.
Prop | Required? | Default | Description |
---|---|---|---|
ref | No | N/A | Mutable object for the Tour. Populated through the provider. |
steps | Yes | N/A | Steps for the tour (array of TourStep ). |
overlayColor | No | black | Color for the overlay (String , Number or rgbaArray ). |
overlayOpacity | No | 0.45 | Opacity of the overlay (Number or String ) |
Method | Description |
---|---|
start | Begin the tour. |
next | Navigate to the next defined step. |
previous | Navigate to the previous step. |
stop | Finish the tour. |
The AttachStep
wraps the components that will be highlighted by the library. It receives the
following properties:
Prop | Required? | Default | Description |
---|---|---|---|
index | Yes | N/A | Defines the order for the tour sequence (Number ). |
disabled | No | false | Defines if the library should highlight the component or not (Boolean ). |
The TourStep
lets you render a component with the information you want to display for each step
in the tour. It has the following properties:
Prop | Required? | Default | Description |
---|---|---|---|
alignTo | No | Align.SPOT | Aligns the step component to the Align.SPOT or the Align.SCREEN . |
before | No | Promise.resolve() | If present, it runs an operation before a step starts. The function can return either void , or Promise<void> . |
render | Yes | - | A function component that will be rendered in the step. The props of this component should include the RenderProps. |
position | Yes | - | The position with respect to the spot where the step component will be rendered. Possible values are Position.BOTTOM , Position.LEFT , Position.RIGHT , or Position.TOP |
These props will be passed to the function component of render
in a TourStep
object. The props contain the following:
Prop | Type | Description |
---|---|---|
current | number | The current step index. Starting from 0 . |
isFirst | boolean | True if the current step is the first step. False otherwise. |
isLast | boolean | True if the current step is the last step. False otherwise. |
next | () => void | Calling it will trigger the next step (if any). |
previous | () => void | Calling it will trigger the previous step (if any). |
stop | () => void | Calling it will end the tour. |
Bellow is a complete example of a TourStep
array:
1import { 2 Align, 3 Position, 4 TourStep, 5 useSpotlightTour 6} from "@stackbuilders/react-native-spotlight-tour"; 7 8const mySteps: TourStep[] = [{ 9 alignTo: Align.SCREEN, 10 position: Position.BOTTOM, 11 render: ({ next }) => ( 12 <View> 13 <Text>This is the first step of tour!</Text> 14 <Button title="Next" onPress={next} /> 15 </View> 16 ) 17}, { 18 alignTo: Align.SPOT, 19 before: () => { 20 return DataService.fetchData() 21 .then(setData); 22 }, 23 position: Position.RIGHT, 24 render: () => { 25 // You can also use the hook inside the step component! 26 const { previous, stop } = useSpotlightTour(); 27 28 return ( 29 <View> 30 <Text>This is the first step of tour!</Text> 31 <Button title="Previous" onPress={previous} /> 32 <Button title="Stop" onPress={stop} /> 33 </View> 34 ); 35 } 36}];
Check out the complete example here.
Contributions are always welcome! If you are interested in contributing, please check out our Conduct Code.
To run the library code locally, please consider the following versions:
No vulnerabilities found.
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
61 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More