3.0.7 • Published 6 years ago

the-drawer v3.0.7

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

the-drawer

Build Status npm Version JS Standard

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

NameTypeDescriptionDefault
onOutsideClickfuncHandle outside tapnull
openboolfalse

TheDrawerStyle

Style for TheDrawer

Props

NameTypeDescriptionDefault
optionsobjectStyle options{}

License

This software is released under the MIT License.

Links