React-awesome-popover
A smart popover component with animation support for ReactJS.
Installation
via NPM
via Yarn
via CDN (unpkg)
UMD library exposed as ReactAwesomePopover
Do not forget to use the stylesheet.
Example
The component supports server-side rendering
You can also use nested popovers
+With react-motion
Set the Motion property to True. Second child becomes a function, It returns the id, popperProps and Arrow.
You need to combine Popper style with motion style
You can also use as a tooltip.
Very simple!.
Props
Prop | Type | Description |
---|---|---|
arrow | Boolean | If False, the arrow is removed |
placement | String | The placement of the popover. Read more.The default value is auto |
targetClass | String | The name of the target class |
contentClass | String | The name of the content class |
arrowClass | String | The name of the arrow class |
action | String | click or hover.The default value is click |
defaultIsOpen | Boolean | Initial opened state when uncontrolled |
onOpen | Function | Callback invoked when the popover opens after it is added to the DOM. |
onClose | Function | Callback invoked when a popover begins to close. |
customArrow | JSX | Returns a custom arrow |
motion | Boolean | Allows react-motion |
modifiers | Object | Allow passing Popper modifiers as props. |
open | Boolean | Whether the popover is visible. Passing this prop puts the popover in controlled mode.To make the popover completely manageable, you must pass the null value to the action prop |
touch | Boolean | The touch event will be triggered instead of the click event |
arrowFill | String | Fill color of the arrow |