Skip to content
This repository has been archived by the owner on Dec 27, 2019. It is now read-only.

the-labo/the-drawer

Repository files navigation

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

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.

Links