Package Exports
- react-faq-generator
- react-faq-generator/dist/cjs/index.js
- react-faq-generator/dist/esm/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-faq-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-faq-generator
This repository contains a simple Frequently Asked Questions Section generator in React applications.
Installation
NPM
npm install react-faq-generatorYARN
yarn add react-faq-generatorUsage
import React from 'react'
import FAQGenerator from 'react-faq-generator'
const MyApp = () => {
const data = [
{
id: 1,
question: 'What was the main cause of World War I?',
answer: 'World War I began after the assassination of Austrian archduke Franz Ferdinand by South Slav nationalist Gavrilo Princip on June 28, 1914.'
},
{
id: 2,
question: 'What countries fought in World War I?',
answer: 'The war pitted the Central Powers (mainly Germany, Austria-Hungary, and Turkey) against the Allies (mainly France, Great Britain, Russia, Italy, Japan, and, from 1917, the United States).'
},
{
id: 3,
question: 'How was trench warfare used in World War I?',
answer: 'The widespread use of machine guns and rapid-firing artillery pieces on the Western Front meant that any exposed soldier was vulnerable.'
}
]
return (
<FAQGenerator data={data} />
)
}
export default MyAppLive Demo
You can check the live demo here
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
data |
array of object | null | An array of questions & answers to be displayed. This prop must be passed. |
title |
string | 'FAQ' | The title of the FAQ section. |
className |
string | '' | The name of the class containing customm css rules to be applied. |
License
MIT © alim1496