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

product-guide

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

product-guide

  • 0.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Repository includes React plugin

Contributions welcome License

Product Guide Widget

image info

Usage:

import ProductGuide, {VerticalPosition, HorizontalPosition} from "product-guide"; // there're also type exports
     <ProductGuide
          isOpen={isOpen}
          onClose={() => setIsOpen(false)}
          verticalPosition={VerticalPosition.Center}
          horizontalPosition={HorizontalPosition.Right}
          steps={[
            {
              selector: "#item1",
              content: () => <span>test content</span>,
            },
            {
              title: "Very long texttttttttttttttttttttttttttttttttttttttttttttttt",
              selector: ".profile-text",
              content: "This one is used for example",
            },
            {
              title: "Yeah, that's the step title",
              selector: ".profile-picture",
              content: "This is your profile picture",
              action: ({stepIndex}) => {
                // here you can do redirect to another page
              }
            }
          ]}
    />
Done !

Types:

AppGuideStep

type Props = {
    palette?: string, // main color theme for the widget
    steps: AppGuideStep[],
    isOpen: boolean,
    closeOnMaskClick?: boolean, // if true, the user can close the widget by clicking on the black mask
    onClose: () => void, // callback for clicking on the X (close) button
    verticalPosition?: VerticalPosition, // prefered vertical position (won't be used if there's no enough space)
    horizontalPosition?: HorizontalPosition, // prefered horizontal position (won't be used if there's no enough space)
    activeStepIndex?: number
    setActiveStepIndex?: (stepIndex: number) => void
}

AppGuideStepActionArgs

interface AppGuideStep {
    title?: any,
    selector?: string, // css selector like "#some-id" or ".some-class"
    content: any,
    action?: (args: AppGuideStepActionArgs) => void
}

interface AppGuideStepActionArgs {
    stepIndex: number
}

Keywords

FAQs

Package last updated on 15 Sep 2021

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