Gathering detailed insights and metrics for reactour-emotion
Gathering detailed insights and metrics for reactour-emotion
Gathering detailed insights and metrics for reactour-emotion
Gathering detailed insights and metrics for reactour-emotion
npm install reactour-emotion
Typescript
Module System
Node Version
NPM Version
Leaving emotions…
Updated on Aug 12, 2022
Adding new step props: observables + highlight selectors
Updated on Jun 15, 2020
disableFocusLock + roundedMask
Updated on Apr 07, 2020
Custom Helper
Updated on Jan 18, 2019
Add close function into step
Updated on Dec 19, 2018
v1.10.0
Updated on Dec 18, 2018
TypeScript (66.41%)
MDX (16.74%)
JavaScript (14.65%)
CSS (2.2%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3,951 Stars
777 Commits
355 Forks
22 Watchers
4 Branches
47 Contributors
Updated on Jul 08, 2025
Latest Version
1.15.2
Package Id
reactour-emotion@1.15.2
Unpacked Size
108.02 kB
Size
27.33 kB
File Count
5
NPM Version
8.19.3
Node Version
19.2.0
Published on
Apr 18, 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
8
4
23
Tourist Guide into your React Components
⚠️ The
master
branch is currently in development. Please use the v1 branch to follow the current versions published.
1npm i -S reactour 2# or 3yarn add reactour
From v1.9.1
styled-components it isn't bundled into the package and is required styled-components@^4
and react@^16.3
due to the use of createRef, so:
1npm i -S styled-components@^4.0.0 2# or 3yarn add styled-components@^4.0.0
Add the Tour
Component in your Application, passing the steps
with the elements to highlight during the Tour.
1import React from 'react' 2import Tour from 'reactour' 3 4class App extends Component { 5 // ... 6 7 render ( 8 <> 9 { /* other stuff */} 10 <Tour 11 steps={steps} 12 isOpen={this.state.isTourOpen} 13 onRequestClose={this.closeTour} /> 14 </> 15 ) 16} 17 18const steps = [ 19 { 20 selector: '.first-step', 21 content: 'This is my first Step', 22 }, 23 // ... 24]
Change
--reactour-accent
(defaults to accentColor on IE) css custom prop to apply color in Helper, number, dots, etc
Type: string
Default: #007aff
Configure accessibility related accessibility options
Type: object
Default:
1 // attribute to associate the dialog with a title for screen readers 2 ariaLabelledBy: null, 3 // aria-label attribute for the close button 4 closeButtonAriaLabel: 'Close', 5 // Show/Hide Navigation Dots for screen reader software 6 showNavigationScreenReaders: true,
Customize Badge content using
current
andtotal
steps values
Type: func
1// example 2<Tour badgeContent={(curr, tot) => `${curr} of ${tot}`} />
Content to be rendered inside the Helper
Type: node | elem
Custom class name to add to the Helper
Type: string
Close the Tour by clicking the Mask
Type: bool
Default: true
Disable interactivity with Dots navigation in Helper
Type: bool
Disable the ability to click or intercat in any way with the Highlighted element
Type: bool
Disable all keyboard navigation (next and prev step) when true, disable only selected keys when array
Type: bool | array(['esc', 'right', 'left'])
1// example 2<Tour disableKeyboardNavigation={['esc']} />
Function triggered each time current step change
Type: func
1// example 2<Tour getCurrentStep={curr => console.log(`The current step is ${curr + 1}`)} />
Programmatically change current step after the first render, when the value changes
Type: number
Custom class name to add to the element which is the overlay for the target element when
disableInteraction
Type: string
Tolerance in pixels to add when calculating if an element is outside viewport to scroll into view
Type: number
You know…
Type: bool
Required: true
Change Next button in last step into a custom button to close the Tour
Type: node
1// example 2<Tour lastStepNextButton={<MyButton>Done! Let's start playing</MyButton>} />
Custom class name to add to the Mask
Type: string
Extra Space between in pixels between Highlighted element and Mask
Type: number
Default: 10
Renders as next button navigation
Type: node
Overrides default
nextStep
internal function
Type: func
Do something after Tour is opened
Type: func
1// example 2<Tour onAfterOpen={target => (document.body.style.overflowY = 'hidden')} />
Do something before Tour is closed
Type: func
1// example 2<Tour onBeforeClose={target => (document.body.style.overflowY = 'auto')} />
Function to close the Tour
Type: func
Required: true
Renders as prev button navigation
Type: node
Overrides default
prevStep
internal function
Type: func
Beautify Helper and Mask with
border-radius
(in px)
Type: number
Default: 0
Smooth scroll duration when positioning the target element (in ms)
Type: number
Default: 1
Offset when positioning the target element after scroll to it
Type: number
Default: a calculation to the center of the viewport
Show/Hide Helper Navigation buttons
Type: bool
Default: true
Show/Hide Helper Close button
Type: bool
Default: true
Show/Hide Helper Navigation Dots
Type: bool
Default: true
Show/Hide number when hovers on each Navigation Dot
Type: bool
Default: true
Show/Hide Helper Number Badge
Type: bool
Default: true
Starting step when Tour is open the first time
Type: number
Default: 0
Array of elements to highlight with special info and props
Type: shape
Required: true
1steps: PropTypes.arrayOf(PropTypes.shape({
2 'selector': PropTypes.string,
3 'content': PropTypes.oneOfType([
4 PropTypes.node,
5 PropTypes.element,
6 PropTypes.func,
7 ]).isRequired,
8 'position':PropTypes.oneOfType([
9 PropTypes.arrayOf(PropTypes.number),
10 PropTypes.oneOf(['top', 'right', 'bottom', 'left', 'center']),
11 ]),
12 'action': PropTypes.func,
13 'style': PropTypes.object,
14 'stepInteraction': PropTypes.bool,
15 'navDotAriaLabel': PropTypes.string,
16})),
1const steps = [ 2 { 3 selector: '[data-tour="my-first-step"]', 4 content: ({ goTo, inDOM }) => ( 5 <div> 6 Lorem ipsum <button onClick={() => goTo(4)}>Go to Step 5</button> 7 <br /> 8 {inDOM && '🎉 Look at your step!'} 9 </div> 10 ), 11 position: 'top', 12 // you could do something like: 13 // position: [160, 250], 14 action: node => { 15 // by using this, focus trap is temporary disabled 16 node.focus() 17 console.log('yup, the target element is also focused!') 18 }, 19 style: { 20 backgroundColor: '#bada55', 21 }, 22 // Disable interaction for this specific step. 23 // Could be enabled passing `true` 24 // when `disableInteraction` prop is present in Tour 25 stepInteraction: false, 26 // Text read to screen reader software for this step's navigation dot 27 navDotAriaLabel: 'Go to step 4', 28 }, 29 // ... 30]
Value to listen if a forced update is needed
Type: string
Delay time when forcing update. Useful when there are known animation/transitions
Type: number
Default: 1
To guarantee a cross browser behaviour we use body-scroll-lock.
Import the library
import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock'
Create the event handlers
disableBody = target => disableBodyScroll(target)
enableBody = target => enableBodyScroll(target)
Then assign them into the Tour props
<Tour
{...props}
onAfterOpen={this.disableBody}
onBeforeClose={this.enableBody}
/>
No vulnerabilities found.
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
10 commit(s) and 7 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
Found 3/27 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
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