@mtburdon/react-collapsible
React collapsible component
Install
npm install --save @mtburdon/react-collapsible
Usage
import React, { Component } from 'react'
import {
Collapsible,
CollapsibleHead,
CollapsibleBody
} from '@mtburdon/react-collapsible'
import '@mtburdon/react-collapsible/dist/index.css'
class Example extends Component {
render() {
return (
<Collapsible>
<CollapsibleHead>Toggle me</CollapsibleHead>
<CollapsibleBody>Some content</CollapsibleBody>
</Collapsible>
)
}
}
Available CSS custom properties
--collapsible-margin
--collapsible-head-background
--collapsible-head-color
--collapsible-head-padding
--collapsible-body-background
--collapsible-body-color
--collapsible-body-padding
Example
License
MIT © martinburdon