@termoxin/react-poll
v1.0.12
Published
This component serves for making polls in React
Downloads
71
Maintainers
Readme
Installation
npm install @termoxin/react-poll
Usage
Using NPM
1 . Require @termoxin/react-poll after installation
import ReactPoll.Poll from "@termoxin/react-poll";
2 . Include semantic-css for styling component
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css"
/>
3 . Include @termoxin/react-poll component
<ReactPoll.Poll />
EXAMPLE
Options
Notes:
- The tooltip sets
type: fill
as default attributes. You don't have to add these options if you don't want to change the defaults
| Global | Type | Values | Description |
| --------- | :-----: | :----------- | :------------------------------------------------------------------------------------------------- |
| questions | Array | | These is an array to use for <Poll />
|
| type | string | arrows, fill | Poll type |
| logging | boolean | true, false | Logs switch on/off for <Logs />
component |
| name | string | | A name that's showing in logs (after each a completed poll, component creates a log in locaStorage |
Data structure for questions:
| Property | Type | Values | Description | | ------------- | :---------------------- | :-------------------- | :--------------------------------------------------------------------------------------------- | | id | number or string | | The question id | | text | string | | The question text | | type | string | fill, checkbox, radio | The question type | | description | string | | The question description | | answers | string or array | | The variety of answers | | correctAnswer | string | | The answers. The data depends on question type(fill, radio - string, checkbox - Array) |
Contributing
We welcome your contribution! Fork the repo, make some changes, submit a pull-request!