3.0.7 • Published 6 years ago
the-drawer v3.0.7
the-drawer
Drawer for the-components
Installation
$ npm install the-drawer --save
Usage
'use strict'
import React from 'react'
import { TheDrawer, TheDrawerStyle } from 'the-drawer'
import { TheButtonStyle } from 'the-button'
import { TheIconStyle } from 'the-icon'
class ExampleComponent extends React.PureComponent {
constructor (props) {
super(props)
const s = this
s.state = {open: false}
}
render () {
const s = this
return (
<div>
<TheIconStyle/>
<TheButtonStyle/>
<TheDrawerStyle/>
<TheDrawer open={s.state.open}
onOutsideClick={() => s.setState({open: false})}>
This is drawer content
</TheDrawer>
<a onClick={() => s.setState({open: !s.state.open})}>TryMe!</a>
</div>
)
}
}
export default ExampleComponent
Components
TheDrawer
Drawer for the-components
Props
Name | Type | Description | Default |
---|---|---|---|
onOutsideClick | func | Handle outside tap | null |
open | bool | false |
TheDrawerStyle
Style for TheDrawer
Props
Name | Type | Description | Default |
---|---|---|---|
options | object | Style options | {} |
License
This software is released under the MIT License.