0.5.10 • Published 6 years ago

react-popover v0.5.10

Weekly downloads
29,556
License
MIT
Repository
github
Last release
6 years ago

:toc: macro :toc-title: :toclevels: 99

react-popover

image:https://travis-ci.org/littlebits/react-popover.svg?branch=master["Build Status", link="https://travis-ci.org/littlebits/react-popover"]

toc::[]

React Versions Support

react-popover >= 0.5.0 supports React 16 while react-popover < 0.5.0 works with React 15.x.x and likely lower. There is no plan to support older versions of this library with back-ported patches and PRs for that purpose are not welcome since it increases maintenance for the authors.

Installation

yarn add react-popover

Examples

Look at the link:https://littlebits.github.io/react-popover[stories in our storybook].

API

export default Popover(props, target)

props :: {...}


body :: Node | Array Node

The popover content.


isOpen :: Boolean

Determines Whether or not the popover is rendered.


preferPlace :: Enum String | Null

Sets a preference of where to position the Popover. Only useful to specify placement in case of multiple available fits. Defaults to null. Valid values are:

above | right | below | left :: Prefer an explicit side. row | column :: Prefer an orientation. start | end :: Prefer an order. null :: No preference, automatic resolution. This is the default.


place :: String | Null

Like preferPlace except that the given place is a requirement. The resolver becomes scoped or disabled. It is scoped if the place is an orientation or order but disabled if it is a side. For example place: "row" scopes the resolver to above or below placement but place: "above" removes any need for the resolver.


onOuterAction :: (Event) -> Void

A callback function executed every time the user does an action (mousedown or touchstart) outside the DOM tree of both Popover and Target. A canonical use-case is to automatically close the Popover on any external user action.


refreshIntervalMs :: Number | Falsey

The polling speed (AKA time between each poll) in milliseconds for checking if a layout refresh is required. This polling is required because it is the only robust way to track the position of a target in the DOM. Defaults to 200. Set to a falsey value to disable.


enterExitTransitionDurationMs :: Number | Falsey

The amount of time in milliseconds that it takes to complete the enter and exit animation. Defaults to '500'.


tipSize :: Number

Defines the size of the tip pointer. Use .01 to disable tip. Defaults to '7'.


Standard
  • Properties like className and style.

target :: ReactElement

  • The React Element that this popover will orient itself around. target rendering tree is unaffected. Popover will become its owner.

appendTarget :: DOMElement

@bidalgo/ui-kit@spacemakerai/component-librarymircoai-gui@secman/dsk-uicrypticcoin-walletcrypticcoin-wallet-testscratch-gui-freerange@echidna/uisujester-components@infinitebrahmanuniverse/nolb-react-po@starbird/myob-widgets@gratico/paperglitchyscratch-guireact-risk-matrixscratch-gui@everything-registry/sub-chunk-2603wb-ui-kitwawu-scratch-guitowneditor-guisdc-sudokuscratchhw-guiscratch-gui-groundhogscratch-gui-liaoscratch-gui-okagvscratch-gui-pearupscratch-arduino-guiscratch-gui-cntshan-scratch-guisimple-pivot-tablesuny-gui@kernel/react@lemontech/tbx@lalamove/karangscratch-gui-astro@raspberrypifoundation/scratch-gui@team-monolith/scratch-gui@idsync/ui@littleorca/ferris-wheel@thomaspollet/jsonapi-admin@timberio/ui@targetprocess/feedback@kaytwo/network-viewer6thman-sharedakid-gui@axah/components@catchandrelease/arbor@buttercup/uihdi-uikititch-scratch-guicodevider-scratch-guicolby-wp-react-search-againbrilliant-editoroutduu-md-image-pluginopenblock-guikulbot-guihaiku-ui-commonkbsnd3clipcc-guimscratchdelightmom-scratch-guipersona-web-locker-uireact-monocle@dunkbing/network-viewerdm-web-reactidsync-web-test@cybergenios/scratch-guibuttercup-uireact-pdc-utilsreact-popover-wrappernetwork-viewerdraft-js-link-entitymegadraft-video-pluginmegadraft-image-pluginmegadraft-imagine-pluginminecraft-storeys-scratch-guiaurora-ui-kit@atrium/componentsanswers-ui-libby-publicreminders-reactreact-fields-validationreact-fiberreact-input-kitinlocker-web-testlockersa-web-testrsoury-marketplace@hapticsynaptic/braceletmaker-guirobopro-gui@hexhive/ui
0.5.10

6 years ago

0.5.9

6 years ago

0.5.7

6 years ago

0.5.6

6 years ago

0.5.5

6 years ago

0.5.4

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.18

7 years ago

0.4.17

7 years ago

0.4.16

7 years ago

0.4.14

7 years ago

0.4.11

7 years ago

0.4.10

7 years ago

0.4.9

7 years ago

0.4.8

7 years ago

0.4.7

7 years ago

0.4.6

7 years ago

0.4.5

7 years ago

0.4.4

8 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.6

9 years ago

0.3.5

9 years ago

0.3.4

9 years ago

0.3.3

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago