@zmzhoi/react-popper

React Popper component that is super easy to use and tiny


Keywords
react, react-dom, popper, popover, react-popper, react-popover, @zmzhoi/react-popper
License
MIT
Install
npm install @zmzhoi/react-popper@1.1.2

Documentation

react-easy-popper

Installation

  npm install react-easy-popper

Usage

import { Popper } from 'react-easy-popper';

...

<Popper
  position={['bottom', 'center']}
  content={<div style={{ background: 'rgba(0,0,0,0.4)' }}>I'm Popper content.</div>}
>
  <button>click me</button>
</Popper>

Props

Property Type Description Example
position string[] . ['bottom', 'centner'],['top', 'right']
content JSX.Element . <div>I'm popper</div>
margin number . 10 (Default: 6)
bubble boolean . true (Default: false)
showOnMount boolean . true (Default: false)
disabled boolean . true (Default: false)
children JSX.Element or Function . <button>click me</button>
arrow object . { color, size, distance }

arrow

Property Type Description Example
arrow.color string . rgba(0,0,0,0.5), red
arrow.size number . 5, 10, 20
arrow.distance string or number . 10%, 20