0.3.0 • Published 7 years ago
react-nps v0.3.0
React NPS
Install
$ npm install react-npsor
$ yarn add react-npsUsage
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 notanimationDuration: number default 2: duration of the animation in second - works only if animated istruemessage: string: message displayed on the NPS componentonClose: function: called when clicked on the close button or when a score is submittedonSubmit: function: function called when a score is submittedopen: boolean default true: whether the panel is open or notstyle: object: the button style, possible keys are:backgroundColor,backgroundActiveColor,textColor, andtextActiveColor