Gathering detailed insights and metrics for @invisionag/react-joyride
Gathering detailed insights and metrics for @invisionag/react-joyride
Gathering detailed insights and metrics for @invisionag/react-joyride
Gathering detailed insights and metrics for @invisionag/react-joyride
npm install @invisionag/react-joyride
Typescript
Module System
Node Version
NPM Version
69.7
Supply Chain
93.8
Quality
81.7
Maintenance
100
Vulnerability
100
License
TypeScript (98.14%)
CSS (1.67%)
HTML (0.19%)
Total Downloads
11,694
Last Day
1
Last Week
12
Last Month
43
Last Year
608
MIT License
7,214 Stars
826 Commits
565 Forks
44 Watchers
2 Branches
44 Contributors
Updated on May 09, 2025
Minified
Minified + Gzipped
Latest Version
1.15.5
Package Id
@invisionag/react-joyride@1.15.5
Unpacked Size
280.85 kB
Size
64.06 kB
File Count
18
NPM Version
6.9.0
Node Version
12.4.0
Cumulative downloads
Total Downloads
4
3
65
This repository is a fork of https://github.com/gilbarbara/react-joyride. It was created to implement some features that we hope to appear in the next major version. Since the next major version has been released, this fork is considered deprecated and no changes should be made to it. The repository exists as documentation of the code for the corresponding NPM package, but is not part of the maintenance cycle.
1npm install --save react-joyride
If you are using SCSS:
1@import "~react-joyride/lib/react-joyride";
Or include this directly in your html:
1<link 2 rel="stylesheet" 3 href="/path/to/react-joyride/lib/react-joyride-compiled.css" 4 type="text/css" 5/>
Include Joyride
in the parent component.
1import Joyride from 'react-joyride'; 2 3export class App extends React.Component { 4 render: function () { 5 return ( 6 <div className="app"> 7 <Joyride 8 ref="joyride" 9 steps={[arrayOfSteps]} 10 run={true} // or some other boolean for when you want to start it 11 debug={true} 12 callback={this.callback} 13 ... 14 /> 15 <YourComponents .../> 16 </div> 17 ); 18 } 19}
Don't forget to pass a ref
to the component.
Please refer to the source code of the demo if you need a practical example.
You can change the initial options passing props to the component.
steps {array}: The tour's steps. Defaults to []
stepIndex {number}: The initial step index. Defaults to 0
run {bool}: Run/stop the tour. Defaults to false
autoStart {bool}: Open the tooltip automatically for the first step, without showing a beacon. Defaults to false
beaconComponent {function}: An alternative component to be used by Joyride instead of the default Beacon
keyboardNavigation {bool}: Toggle keyboard navigation (esc, space bar, return). Defaults to true
locale {object}: The strings used in the tooltip. Defaults to { back: 'Back', close: 'Close', last: 'Last', next: 'Next', skip: 'Skip' }
resizeDebounce {bool}: Delay the reposition of the current step while the window is being resized. Defaults to false
resizeDebounceDelay {number}: The amount of delay for the resizeDebounce
callback. Defaults to 200
holePadding {number}: The gap around the target inside the hole. Defaults to 5
scrollOffset {number}: The scrollTop offset used in scrollToSteps
. Defaults to 20
scrollToSteps {bool}: Scroll the page to the next step if needed. Defaults to true
scrollToFirstStep {bool}: Scroll the page for the first step. Defaults to false
showBackButton {bool}: Display a back button. Defaults to true
showOverlay {bool}: Display an overlay with holes above your steps (for tours only). Defaults to true
allowClicksThruHole {bool}: Allow mouse and touch events within overlay hole, and prevent hole:click
callback from being sent. Defaults to false
showSkipButton {bool}: Display a link to skip the tour. Defaults to false
showStepsProgress {bool}: Display the tour progress in the next button e.g. 2/5 in continuous
tours. Defaults to false
tooltipComponent {function}: An alternative component to be used by Joyride instead of the default Tooltip
tooltipOffset {number}: The tooltip offset from the target. Defaults to 30
type {string}: The type of your presentation. It can be continuous
(played sequentially with the Next button) or single
. Defaults to single
disableOverlay {bool}: Don't close the tooltip on clicking the overlay. Defaults to false
debug {bool}: Console.log Joyride's inner actions. Defaults to false
callback {function}: It will be called when the tour's state changes and returns a single parameter:
{ type: 'step:before', index: 0, step: {...} }
{ type: 'beacon:before', step: {...} }
{ type: 'beacon:trigger', step: {...} }
{ type: 'tooltip:before', step: {...} }
{ type: 'step:after', step: {...} }
{ type: 'overlay:click', step: {...} }
{ type: 'hole:click', step: {...} }
{ type: 'error:target_not_found', step: {...} }
{ type: 'finished', steps: [{...}], isTourSkipped: boolean }
The callback object also receives an action
string ('start'|'next'|'back') and the step index
.
Defaults to undefined
Call this method to reset the tour iteration back to 0
restart
{boolean} - Starts the tour againCall this method to programmatically advance to the next step.
Call this method to programmatically return to the previous step.
Add tooltips in your elements.
data
{object} - A step object (check the syntax below)Retrieve the current progress of your tour. The object returned looks like this:
1{ 2 index: 2, 3 percentageComplete: 50, 4 step: { 5 title: "...", 6 text: "...", 7 selector: "...", 8 position: "...", 9 ... 10 } 11}}
start
and stop
methods anymore. Instead use a combination of the props run
and autoStart
.There are some usable options but you can pass custom parameters.
title
: The tooltip's title.text
: The tooltip's content. It can be plain text, html or a React component.selector
: The target DOM selector or element reference of your feature (required)position
: Relative position of you beacon and tooltip. It can be one of these:top
, top-left
, top-right
, bottom
, bottom-left
, bottom-right
, right
and left
. This defaults to top
.type
: The event type that trigger the tooltip: click
or hover
. Defaults to click
isFixed
: If true
, the tooltip will remain in a fixed position within the viewport. Defaults to false
.allowClicksThruHole
: Set to true
to allow pointer-events (hover, clicks, etc) or touch events within overlay hole. If true
, the hole:click
callback will not be sent. Defaults to false
. Takes precedence over a allowClicksThruHole
prop provided to <Joyride />
style
: An object with stylesheet options.Extra option for standalone tooltips
trigger
: The DOM element that will trigger the tooltipYou can style the tooltip UI for each step with these options: backgroundColor
, borderRadius
, color
, mainColor
, textAlign
and width
.
You can also style header
, main
, footer
, button
, skip
, back
, close
and hole
independently using standard style options. Plus beacon
offset, inner and outer colors and arrow
visibility.
Example:
1{ 2 title: 'First Step', 3 text: 'Start using the <strong>joyride</strong>', 4 selector: '.first-step', 5 position: 'bottom-left', 6 type: 'hover', 7 isFixed: true, 8 // optional styling 9 style: { 10 backgroundColor: 'rgba(0, 0, 0, 0.8)', 11 borderRadius: '0', 12 color: '#fff', 13 mainColor: '#ff4456', 14 textAlign: 'center', 15 width: '29rem', 16 arrow: { 17 display: 'none' 18 }, 19 beacon: { 20 offsetX: 10, 21 offsetY: 10, 22 inner: '#000', 23 outer: '#000' 24 }, 25 header: { 26 textAlign: 'right' 27 // or any style attribute 28 }, 29 main: { 30 padding: '20px' 31 }, 32 footer: { 33 display: 'none' 34 }, 35 skip: { 36 color: '#f04' 37 }, 38 hole: { 39 backgroundColor: 'rgba(201, 23, 33, 0.2)', 40 } 41 ... 42 }, 43 // custom params... 44 name: 'my-first-step', 45 parent: 'MyComponentName' 46}
react-joyride provides a way to pass your own rendering logic to its tour components. Be aware that this requires working knowledge of how the Tooltip component works internally.
Example:
1import Joyride from "react-joyride"; 2import Tooltip from "react-joyride/lib/Tooltip"; 3 4const CustomTooltip = ( 5 <Tooltip 6 render={(tooltipProps, tooltipState) => ( 7 <div> 8 <span className="custom-header" style={tooltipState.styles.header}> 9 {tooltipProps.step.title} 10 </span> 11 </div> 12 )} 13 /> 14); 15 16return ( 17 <Joyride /* ... other Joyride props */ tooltipComponent={CustomTooltip} /> 18);
$joyride-color
: The base color. Defaults to #f04
$joyride-zindex
: Defaults to 1500
$joyride-overlay-color
: Defaults to rgba(#000, 0.5)
$joyride-beacon-color
: Defaults to $joyride-color
$joyride-beacon-size
: Defaults to 36px
$joyride-hole-border-radius
: Defaults to 4px
$joyride-hole-shadow
: Defaults to 0 0 15px rgba(#000, 0.5)
$joyride-tooltip-arrow-size
: You must use even numbers to avoid half-pixel inconsistencies. Defaults to 28px
$joyride-tooltip-bg-color
: Defaults to #fff
$joyride-tooltip-border-radius
: Defaults to 4px
$joyride-tooltip-color
: The header and text color. Defaults to #555
$joyride-tooltip-font-size
: Defaults to 16px
$joyride-tooltip-padding
: Defaults to 20px
$joyride-tooltip-shadow
: Sass list for drop-shadow. Defaults to (x: 1px, y: 2px, blur: 3px, color: rgba(#000, 0.3))
$joyride-tooltip-width
: Sass list of Mobile / Tablet / Desktop sizes. Defaults to (290px, 360px, 450px)
$joyride-header-color
: Defaults to $joyride-tooltip-header-color
$joyride-header-font-size
: Defaults to 20px
$joyride-header-border-color
: Defaults to $joyride-color
$joyride-header-border-width
: Defaults to 1px
$joyride-button-bg-color
: Defaults to $joyride-color
$joyride-button-color
: Defaults to #fff
$joyride-button-border-radius
: Defaults to 4px
$joyride-back-button-color
: Defaults to $joyride-color
$joyride-skip-button-color
: Defaults to #ccc
$joyride-close
: Sass list for the close button: Defaults to (color: rgba($joyride-tooltip-color, 0.5), size: 12px, top: 10px, right: 10px)
$joyride-close-visible
: Default to true
;Inspired by react-tour-guide and jquery joyride tour
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 9
Details
Reason
0 commit(s) and 9 issue activity found in the last 90 days -- score normalized to 7
Reason
Found 0/15 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
18 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
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 MoreLast Day
0%
1
Compared to previous day
Last Week
71.4%
12
Compared to previous week
Last Month
-48.2%
43
Compared to previous month
Last Year
-37.6%
608
Compared to previous year