React NPS
Install
$ npm install react-nps
or
$ yarn add react-nps
Usage
;
Then in your render :
{ event; this;} ... <NPS onClose=thisonClose onSubmit=thisonSubmit open=thisstateopen />
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 istrue
message: 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