Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RevereCRE/react-spotlight-tour

Repository files navigation


React Spotlight Tour

A self-configuring tutorial library for React.
Blog | Docs | Demo | npm

Features

  • Clean and unobtrusive overlay to highlight the important parts of your app inspired by Chardin.js
  • Lightweight, only depends on React and the Spotlight component can be lazy-loaded
  • Uses composable React hooks to build tutorials rather than selectors
  • Mobile and desktop support
  • Fully typed with TypeScript!

Getting Started

react-spotlight-tour comes with everything you need built into the npm package, no need for integration with bundlers. Install the package with:

$ npm install react-spotlight-tour

Example Usage

import { useState } from 'react';
import { SpotlightTour, useSpotlight } from 'react-spotlight-tour';
import Spotlight from 'react-spotlight-tour/spotlight';
function StatusUpdateInput() {
 const spotlightRef = useSpotlight('Update your status');
 // ...
 return (
 <div ref={spotlightRef}>
 <textarea />
 <button>Update status</button>
 </div>
 );
}
function HomePage() {
 const [isOpen, setOpen] = useState(false);
 return (
 <SpotlightTour
 open={isOpen}
 onClose={() => setOpen(false)}
 Spotlight={Spotlight}
 >
 <StatusUpdateInput />
 </SpotlightTour>
 );
}

Contributing

To test changes locally run:

$ npx tsc --module es2015 --outDir website/src/react-spotlight-tour

You can then see your changes live on the documentation website by running:

$ cd website
$ npm start

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /