{"id":17700906,"url":"https://github.com/wrathchaos/react-native-poll","last_synced_at":"2025-05-06T20:44:51.702Z","repository":{"id":48861981,"uuid":"306053983","full_name":"WrathChaos/react-native-poll","owner":"WrathChaos","description":"Voting and poll library for React Native with fully customizable options","archived":false,"fork":false,"pushed_at":"2023-07-10T07:32:44.000Z","size":4367,"stargazers_count":54,"open_issues_count":6,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T02:41:27.229Z","etag":null,"topics":["android","app","application","choice","front-end","ios","javascript","mobile","poll","polling","react","react-native","react-native-poll","react-native-vote","reactjs","typescript","vote","voting"],"latest_commit_sha":null,"homepage":"https://freakycoder.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WrathChaos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-21T14:36:56.000Z","updated_at":"2024-11-06T21:48:11.000Z","dependencies_parsed_at":"2024-10-24T21:25:11.192Z","dependency_job_id":"1f66c5ca-b5c6-421f-bbeb-81ca670c3cc0","html_url":"https://github.com/WrathChaos/react-native-poll","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"WrathChaos/react-native-typescript-library-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-poll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-poll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-poll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WrathChaos%2Freact-native-poll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WrathChaos","download_url":"https://codeload.github.com/WrathChaos/react-native-poll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252769128,"owners_count":21801373,"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":["android","app","application","choice","front-end","ios","javascript","mobile","poll","polling","react","react-native","react-native-poll","react-native-vote","reactjs","typescript","vote","voting"],"created_at":"2024-10-24T17:43:37.857Z","updated_at":"2025-05-06T20:44:51.675Z","avatar_url":"https://github.com/WrathChaos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg alt=\"React Native Poll\" src=\"assets/logo.png\" width=\"1050\"/\u003e\n\n[![Voting and poll library for React Native with fully customizable options](https://img.shields.io/badge/-Voting%20and%20poll%20library%20for%20React%20Native%20with%20fully%20customizable%20options-orange?style=for-the-badge)](https://github.com/WrathChaos/react-native-poll)\n\n[![npm version](https://img.shields.io/npm/v/react-native-poll.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-poll)\n[![npm](https://img.shields.io/npm/dt/react-native-poll.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-poll)\n![Platform - Android and iOS](https://img.shields.io/badge/platform-Android%20%7C%20iOS-blue.svg?style=for-the-badge)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=for-the-badge)](https://github.com/prettier/prettier)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"React Native Poll\"\n        src=\"assets/Screenshots/react-native-poll.gif\" /\u003e\n\u003c/p\u003e\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cb\u003eReact Native Poll\u003c/b\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cb\u003eReact Native Poll Choice Selected\u003c/b\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e \n      \u003cimg alt=\"React Native Poll\" src=\"assets/Screenshots/react-native-poll.png\"  /\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003cimg alt=\"React Native Poll\" src=\"assets/Screenshots/react-native-poll-selected.png\"  /\u003e\n    \u003c/td\u003e\n   \u003c/tr\u003e\n\u003c/table\u003e\n\n# Installation\n\nAdd the dependency:\n\n```bash\nnpm i react-native-poll\n```\n\n## Peer Dependencies\n\n\u003ch5\u003e\u003ci\u003eIMPORTANT! You need install them\u003c/i\u003e\u003c/h5\u003e\n\n```js\n\"@freakycoder/react-native-bounceable\": \"\u003e= 0.2.4\",\n```\n\n# Usage\n\n## Import\n\n```jsx\nimport RNPoll, { IChoice } from \"react-native-poll\";\n```\n\n## Fundamental Usage\n\n```jsx\nimport RNPoll, { IChoice } from \"react-native-poll\";\n\n\u003cRNPoll\n  totalVotes={30}\n  choices={choices}\n  onChoicePress={(selectedChoice: IChoice) =\u003e\n    console.log(\"SelectedChoice: \", selectedChoice)\n  }\n/\u003e\n```\n\n## Advanced Usage\n\n```jsx\nimport RNAnimated from \"react-native-animated-component\";\nimport RNPoll, { IChoice } from \"react-native-poll\";\n\n\u003cRNPoll\n  appearFrom=\"left\"\n  animationDuration={750}\n  totalVotes={30}\n  choices={choices}\n  PollContainer={RNAnimated}\n  PollItemContainer={RNAnimated}\n  onChoicePress={(selectedChoice: IChoice) =\u003e\n    console.log(\"SelectedChoice: \", selectedChoice)\n  }\n/\u003e;\n```\n\n## Data Format (IChoice)\n\nYou must use this data format for generating the poll choices\n\n```js\nconst choices: Array\u003cIChoice\u003e = [\n  { id: 1, choice: \"Nike\", votes: 12 },\n  { id: 2, choice: \"Adidas\", votes: 1 },\n  { id: 3, choice: \"Puma\", votes: 3 },\n  { id: 4, choice: \"Reebok\", votes: 5 },\n  { id: 5, choice: \"Under Armour\", votes: 9 },\n];\n```\n\n## Example Project 😍\n\nYou can checkout the example project 🥰\n\nSimply run\n\n- `npm i`\n- `react-native run-ios/android`\n\nshould work of the example project.\n\n# Configuration - Props\n\n## Fundamentals\n\n| Property      |      Type      |  Default  | Description                                          |\n|---------------|:--------------:|:---------:|------------------------------------------------------|\n| totalVotes    |     number     | undefined | set the total votes of the poll                      |\n| choices       | Array\u003cIChoice\u003e | undefined | set the choices array for the generating them        |\n| onChoicePress |    function    |  default  | set your own logic when a choice is pressed/selected |\n\n## Customization (Optionals)\n\n| Property                   |    Type    |  Default  | Description                                                                                                                                                                    |\n|----------------------------|:----------:|:---------:|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| hasBeenVoted               |  boolean   |   false   | let you to enable if the poll is already voted                                                                                                                                 |\n| votedChoiceByID            | number(id) | undefined | let you to select the already voted poll choice                                                                                                                                |\n| disableBuiltInIncreaseVote |  boolean   |   false   | enable/disable the built-in automatically increase the vote system when a choice is selected                                                                                   |\n| disableBuiltInIncreaseVote |  boolean   |   false   | enable/disable the built-in automatically increase the vote system when a choice is selected                                                                                   |\n| style                      | ViewStyle  |  default  | set or override the style object for the main container                                                                                                                        |\n| pollContainerStyle         | ViewStyle  |  default  | set or override the style object for the poll inner container                                                                                                                  |\n| choiceTextStyle            | TextStyle  |  default  | set or override the style object for the choice text style                                                                                                                     |\n| percentageTextStyle        | TextStyle  |  default  | set or override the style object for the percentage text style                                                                                                                 |\n| checkMarkImageStyle        | ImageStyle |  default  | set or override the style object for the checkmark image style                                                                                                                 |\n| pollItemContainerStyle     | ViewStyle  |  default  | set or override the style object for the poll item container                                                                                                                   |\n| borderColor                |   color    |  #aabee3  | change the border color                                                                                                                                                        |\n| fillBackgroundColor        |   color    |  #aabee3  | change the filling background color                                                                                                                                            |\n| checkMarkIconImageSource   |  ISource   |  default  | change the check mark image source                                                                                                                                             |\n| defaultChoiceBorderWidth   |   number   |    0.5    | change the default choice's border width                                                                                                                                       |\n| selectedChoiceBorderWidth  |   number   |     1     | change the selected choice's border width                                                                                                                                      |\n| PollContainer              | component  |  default  | set your own component instead of default react-native View component such as [react-native-animated-component](https://github.com/WrathChaos/react-native-animated-component) |\n| PollItemContainer          | component  |  default  | set your own component instead of default react-native View component such as [react-native-animated-component](https://github.com/WrathChaos/react-native-animated-component) |\n| ImageComponent             | component  |  default  | set your own component instead of default react-native Image component such as `FastImage`                                                                                     |\n\n## Future Plans\n\n- [x] ~~LICENSE~~\n- [ ] More animation options\n- [ ] Other poll design options\n- [ ] Write an article about the lib on Medium\n\n## Credits\n\nInspired on [aarkalyk](https://github.com/aarkalyk/react-native-polls-api-example)\n\n## Author\n\nFreakyCoder, kurayogun@gmail.com\n\n## License\n\nReact Native Poll is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrathchaos%2Freact-native-poll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrathchaos%2Freact-native-poll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrathchaos%2Freact-native-poll/lists"}