1.0.4 • Published 3 years ago

react-material-popover v1.0.4

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

react-material-popover

A simple material-ui popover using ref instead of state

NPM JavaScript Style Guide

Install

npm install --save react-material-popover
yarn add react-material-popover

Usage

import React, { useRef } from 'react'
import MaterialPopover from 'react-material-popover'

const Content = ({ closePopover }) => {
  return (
    <button onClick={closePopover} style={{ padding: '2rem' }}>
      Close
    </button>
  )
}
const App = () => {
  const ref = useRef(null)
  return (
    <>
      <button ref={ref}>test</button>
      <MaterialPopover
        ref={ref}
        paper={{ borderRadius: '5px' }}
        anchorOrigin={{
          vertical: 'bottom',
          horizontal: 'left'
        }}
        transformOrigin={{
          vertical: 'top',
          horizontal: 'left'
        }}
      >
        <Content></Content>
      </MaterialPopover>
    </>
  )
}

License

MIT © InterviewCandies

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago