npm promotes metadefinitions

    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

    84

    Version

    0.3.0

    License

    MIT

    Unpacked Size

    406 kB

    Total Files

    35

    Last publish

    Collaborators

    • gregoireh