1.0.12 • Published 5 years ago

@termoxin/react-poll v1.0.12

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

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/semantic-ui@2.4.2/dist/semantic.min.css"
/>

3 . Include @termoxin/react-poll component

<ReactPoll.Poll />

EXAMPLE

Example's code

Check demo

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
GlobalTypeValuesDescription
questionsArrayThese is an array to use for <Poll />
typestringarrows, fillPoll type
loggingbooleantrue, falseLogs switch on/off for <Logs /> component
namestringA name that's showing in logs (after each a completed poll, component creates a log in locaStorage

Data structure for questions:

PropertyTypeValuesDescription
idnumber or stringThe question id
textstringThe question text
typestringfill, checkbox, radioThe question type
descriptionstringThe question description
answersstring or arrayThe variety of answers
correctAnswerstringThe 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!

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago