https://github.com/adrienjoly/react-1poll
A simple React component to make doodle-like collaborative polls.
https://github.com/adrienjoly/react-1poll
doodle poll react react-component
Last synced: about 1 month ago
JSON representation
A simple React component to make doodle-like collaborative polls.
- Host: GitHub
- URL: https://github.com/adrienjoly/react-1poll
- Owner: adrienjoly
- License: mit
- Created: 2016-06-23T11:10:46.000Z (almost 9 years ago)
- Default Branch: gh-pages
- Last Pushed: 2016-07-11T17:05:48.000Z (almost 9 years ago)
- Last Synced: 2025-02-28T21:17:00.495Z (about 2 months ago)
- Topics: doodle, poll, react, react-component
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/react-1poll
- Size: 1.67 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-1poll
A simple [Doodle](http://doodle.com)-like poll component that makes it easy for contributors to add more options. Star it on [npm](https://www.npmjs.com/package/react-1poll) and on [github](https://github.com/adrienjoly/react-1poll).
Made with [React.js](https://facebook.github.io/react/) and [Material-UI](material-ui.com). Thanks to [Romain Dardour](http://twitter.com/rdardour) for his help!
## Contents
The `gh-pages` branch of this repository contains:
- The `1poll` react component, as defined in [the component subdirectory](https://github.com/adrienjoly/1poll/tree/gh-pages/component);
- A [demo page](http://adrienjoly.com/react-1poll/demo) to demonstrate the use of the `1poll` component.## Demo / examples of use
- [Official demo](http://adrienjoly.com/react-1poll/demo)
- [1task's landing page](http://1task.org/) (and [source code](https://github.com/adrienjoly/1task))## How to install and use
### Using npm
First, install it in your project's directory:
npm install react-1poll
Then, integrate it in your javascript project:
```jsx
var PollForm = require('./PollForm.jsx');
var options = [
{ name: 'Option A', defaultCheck: true },
{ name: 'Option B' },
{ name: 'Option C' }
];
function onValidSubmit(selectedItems) {
assert.equal(selectedItems, [ 'Option A' ]);
}
ReactDOM.render(, appDiv);
```## Component API reference
See [1poll component's README.md file](https://github.com/adrienjoly/react-1poll/tree/gh-pages/component).