{"id":17929814,"url":"https://github.com/samypesse/react-nps-input","last_synced_at":"2025-03-24T04:31:08.999Z","repository":{"id":66202949,"uuid":"83148034","full_name":"SamyPesse/react-nps-input","owner":"SamyPesse","description":"React component to prompt the NPS score","archived":false,"fork":false,"pushed_at":"2019-02-12T00:20:17.000Z","size":417,"stargazers_count":23,"open_issues_count":3,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T05:34:38.491Z","etag":null,"topics":["marketing","nps","react"],"latest_commit_sha":null,"homepage":"https://samypesse.github.io/react-nps-input/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamyPesse.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-02-25T17:12:27.000Z","updated_at":"2023-11-25T06:13:31.000Z","dependencies_parsed_at":"2023-03-01T09:30:46.698Z","dependency_job_id":null,"html_url":"https://github.com/SamyPesse/react-nps-input","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamyPesse%2Freact-nps-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamyPesse%2Freact-nps-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamyPesse%2Freact-nps-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamyPesse%2Freact-nps-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamyPesse","download_url":"https://codeload.github.com/SamyPesse/react-nps-input/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244339023,"owners_count":20437167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["marketing","nps","react"],"created_at":"2024-10-28T21:10:37.449Z","updated_at":"2025-03-24T04:31:08.715Z","avatar_url":"https://github.com/SamyPesse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-nps-input\n\n[![Build Status](https://travis-ci.org/SamyPesse/react-nps-input.svg?branch=master)](https://travis-ci.org/SamyPesse/react-nps-input)\n[![NPM version](https://badge.fury.io/js/react-nps-input.svg)](http://badge.fury.io/js/react-nps-input)\n\nA lightweight React component for gathering Net Promoter Score surveys. [See demo](http://samypesse.github.io/react-nps-input/).\n\n### Installation\n\n```\n$ npm install react-nps-input --save\n```\n\n### Usage\n\n```js\nconst React = require('react');\nconst NPSInput = require('react-nps-input');\n\nconst MyApp = React.createClass({\n    onSubmit({ score }) {\n        console.log(`Score for current user is ${score}/10`);\n    },\n\n    render() {\n        return (\n            \u003cdiv\u003e\n                \u003cNPSInput onSubmit={this.onSubmit}\u003e{({ score }) =\u003e {\n                    if (score \u003e= 9) {\n                        return \u003cp\u003eAwesome thank you!\u003c/p\u003e;\n                    } else {\n                        return \u003cp\u003eOh :(\u003c/p\u003e;\n                    }\n                }}\u003c/NPSInput\u003e\n            \u003c/div\u003e\n        );\n    }\n})\n```\n\n### Props\n\n- `[Function] onSubmit`: function to call when the user clicked on a score\n- `[Function] onDismissed`: function to call when the user clicked to dismiss the form\n- `[String] service` (Optional): name of the service for the introduction message\n- `[Boolean] animated` (Optional): show animation for apparition (default is `true`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamypesse%2Freact-nps-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamypesse%2Freact-nps-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamypesse%2Freact-nps-input/lists"}