Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reactjs-intro

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reactjs-intro

React Intro is a library for creating step-by-step and powerful customer onboarding tours

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

React Intro

React Intro is a library for creating step-by-step and powerful customer onboarding tours DEMO

NPM JavaScript Style Guide

Install

npm install --save reactjs-intro

Steps

const steps = [
  {
    selector: "#intro-1",
    position: "right-center",
    children: (
      <div>
        <p>
          Lorem Ipsum is simply dummy text of the printing and typesetting
          industry.
        </p>
      </div>
    ),
  },
  {
    selector: "#intro-2",
    position: "left-start"
    children: (
      <div>
        <p>
          Lorem Ipsum is simply dummy text of the printing and typesetting
          industry.
        </p>
      </div>
    ),
  },
  {
    selector: "#intro-3",
    position: "top-end"
    children: (
      <div>
        <p>
          Lorem Ipsum is simply dummy text of the printing and typesetting
          industry.
        </p>
      </div>
    ),
  },
];
NameDescriptionType
selectorCSS selectorString
positionPosition of the tooltipString
childrenThe tooltip contentString or JSX

Usage

import Intro from "react-intro";
import "react-intro/dist/index.css";

const Example = () => {
  const [enabled, setEnabled] = useState(false);

  const toggle = () => {
    setEnabled(!enabled);
  };

  return <Intro steps={steps} enabled={enabled} onComplete={toggle} />;
};

PropTypes

Intro.propTypes = {
  steps: PropTypes.arrayOf(
    PropTypes.shape({
      selector: PropTypes.string.isRequired,
      position: PropTypes.oneOf([
        "left-center",
        "left-start",
        "left-end",
        "right-center",
        "right-start",
        "right-end",
        "top-center",
        "top-start",
        "top-end",
        "bottom-center",
        "bottom-start",
        "bottom-end",
      ]).isRequired,
      children: PropTypes.node.isRequired,
    })
  ),
  enabled: PropTypes.bool,
  initialStep: PropTypes.number,
  onComplete: PropTypes.func,
  onChange: PropTypes.func,
  nextLabel: PropTypes.string,
  backLabel: PropTypes.string,
  doneLabel: PropTypes.string,
};

Intro.defaultProps = {
  steps: [],
  initialStep: 0,
  enabled: false,
  onChange: () => {},
  onComplete: () => {},
  nextLabel: "Next",
  backLabel: "Back",
  doneLabel: "Done",
};

Props

NameTypeDescription
enabledBooleanDefines if the steps are visible or not.
initialStepNumberStep to show at the beginning
stepsArrayAll the steps.
onChangeFunctionCallback called when the steps are changed and the callback function will receive the current step as parameter
onCompleteFunctionCallback called when all the steps are completed
nextLabelStringLabel for next button
doneLabelStringLabel for done button
backLabelStringLabel for back button

License

MIT © https://github.com/vkaswin/react-intro.git

FAQs

Package last updated on 15 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc