react-simple-collapsible-element
Advanced tools
Comparing version 1.2.10 to 1.2.11
{ | ||
"name": "react-simple-collapsible-element", | ||
"version": "1.2.10", | ||
"version": "1.2.11", | ||
"description": "simple react collapsible supports nested elements", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,2 +5,4 @@ # react-simple-collapsible-element | ||
[Demo](http://dashing-attention.surge.sh/). | ||
## Install | ||
@@ -21,18 +23,18 @@ | ||
```js | ||
import Collapsible from 'react-simple-collapsible-element'; | ||
import Collapsible from 'react-simple-collapsible-element'; | ||
const data = [ | ||
{ | ||
title: 'title 1', | ||
content: 'content 1' | ||
}, | ||
{ | ||
title: 'title 2', | ||
contentStyle: { backgroundColor: 'red' } , // can be a classname also. | ||
activeContentStyle: 'activeContentStyle', // classname | ||
content: 'content 2' | ||
}, | ||
]; | ||
const data = [ | ||
{ | ||
title: 'title 1', | ||
content: 'content 1' | ||
}, | ||
{ | ||
title: 'title 2', | ||
contentStyle: { backgroundColor: 'red' }, // can be a classname also. | ||
activeContentStyle: 'activeContentStyle', // classname | ||
content: 'content 2' | ||
} | ||
]; | ||
return <Collapsible data={data} /> | ||
return <Collapsible data={data} />; | ||
``` | ||
@@ -43,3 +45,3 @@ | ||
```js | ||
import Collapsible from 'react-simple-collapsible-element'; | ||
import Collapsible from 'react-simple-collapsible-element'; | ||
@@ -61,3 +63,3 @@ const data = [ | ||
contentStyle: { backgroundColor: 'red' }, // can be a classname also. | ||
activeContentStyle: 'activeContentStyle', | ||
activeContentStyle: 'activeContentStyle' | ||
} | ||
@@ -68,3 +70,3 @@ ] | ||
return <Collapsible data={data} /> | ||
return <Collapsible data={data} />; | ||
``` | ||
@@ -74,10 +76,9 @@ | ||
| Name | Type | Default | Description| | ||
|:---- |:---- |:---- |:----| | ||
| `title` | `Element` | `'div'` | parent | | ||
| `content` | `Element / array` | `div` | child | | ||
| `titleStyle` | `String / Object` | `undefined` | Can be a style object or multiple classnames together.| | ||
| `contentStyle` | `String / Object` | `undefined` | Can be a style object or multiple classnames together.| | ||
| `activeTitleStyle` | `String` | `undefined` | a classname to pass to when the title is active.| | ||
| `activeContentStyle` | `String` | `undefined` | a classname to pass to when the content is active.| | ||
| Name | Type | Default | Description | | ||
| :------------------- | :---------------- | :---------- | :----------------------------------------------------- | | ||
| `title` | `Element` | `'div'` | parent | | ||
| `content` | `Element / array` | `div` | child | | ||
| `titleStyle` | `String / Object` | `undefined` | Can be a style object or multiple classnames together. | | ||
| `contentStyle` | `String / Object` | `undefined` | Can be a style object or multiple classnames together. | | ||
| `activeTitleStyle` | `String` | `undefined` | a classname to pass to when the title is active. | | ||
| `activeContentStyle` | `String` | `undefined` | a classname to pass to when the content is active. | |
410925
79