npm

Need private packages and team management tools?Check out npm Orgs. »

react-nps

0.3.0 • Public • Published

React NPS

npm (scoped) npm (scoped)

Install

$ npm install react-nps

or

$ yarn add react-nps

Usage

import NPS from "react-nps";

Then in your render :

onClose = (event) => {
  event.preventDefault();
 
  this.setState({ open: false });
}
 
...
 
<NPS onClose={this.onClose} onSubmit={this.onSubmit} open={this.state.open} />

Available props

  • animated: boolean default true: whether the panel is animated or not
  • animationDuration: number default 2: duration of the animation in second - works only if animated is true
  • message: string: message displayed on the NPS component
  • onClose: function: called when clicked on the close button or when a score is submitted
  • onSubmit: function: function called when a score is submitted
  • open: boolean default true: whether the panel is open or not
  • style: object: the button style, possible keys are: backgroundColor, backgroundActiveColor, textColor, and textActiveColor

Keywords

install

npm i react-nps

Downloadsweekly downloads

5

version

0.3.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability