1.0.0 • Published 6 years ago

@fishx/drawer v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

@fishx/drawer

Installation

yarn add @fishx/drawer

Quick Start

import React from 'react'
import { Drawers, DrawerConfig, drawerStore } from '@fishx/drawer'

const About = () => (
  <span>
    about
    <button onClick={() => drawerStore.close('about')}>close</button>
  </span>
)

About.drawerProps = {
  title: 'about me',
  width: '80%',
}

const config: DrawerConfig = [
  {
    name: 'about',
    component: About,
  },
]

export default () => (
  <div>
    <Drawers config={config} />
    <span>Hi, Dahlia</span>
    <button onClick={() => drawerStore.open('about')}>open</button>
  </div>
)
1.0.0

6 years ago