Demo
FAQ (How it works)
Lorem ipsum dolor sit amet,
Nunc maximus, magna at ultricies elementum
Can I use html as content
What is the package version
Usage
Install the package.
npm install --save react-faq-component
Import the package.
import Faq from 'react-faq-component';
example:
import React, { Component } from 'react';
import Faq from 'react-faq-component';
const data = {
title: "FAQ (How it works)",
rows: [
{
title: "Lorem ipsum dolor sit amet,",
content: "Lorem ipsum dolor sit amet, consectetur "
},
{
title: "Nunc maximus, magna at ultricies elementum",
content: "Nunc maximus, magna at ultricies elementum, risus turpis vulputate quam."
},
{
title: "Curabitur laoreet, mauris vel blandit fringilla",
content: "Curabitur laoreet, mauris vel blandit fringilla, leo elit rhoncus nunc"
},
{
title: "What is the package version",
content: "v1.0.5"
}]
}
export default class App extends Component {
render() {
return (
<div>
<Faq data={data}/>
</div>
)
}
}
Data format
The data passed into react-faq-component is an object having two keys i.e title (String) and rows (array of objects).
{
"title": "FAQ title",
"rows": [
{
"title": "Question 1",
"content": "Answer 1"
},
{
"title": "Question 2",
"content": "Answer 2"
}
]
}