popover

v4.9.10arrow_drop_down
v4.9.10
v4.5.2
v3.9.2
STATUS
Passing
DOWNLOADS
39,589
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
4 years ago
SIZE
35 KB
A ref for imperative actions.
2 contributors
Install popover as a package?
Copied
npm i @bit/mui-org.material-ui.popover
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
chevron_left
chevron_right

A ref for imperative actions. It currently only supports updatePosition() action.

This is the DOM element, or a function that returns the DOM element, that may be used to set the position of the popover.

This is the point on the anchor where the popover’s anchorEl will attach to. This is not used when the anchorReference is 'anchorPosition’.

Options: vertical: [top, center, bottom]; horizontal: [left, center, right].

This is the position that may be used to set the position of the popover. The coordinates are relative to the application’s client area.

This determines which anchor prop to refer to to set the position of the popover.

The content of the component.

A node, component instance, or function that returns either. The container will passed to the Modal component. By default, it uses the body of the anchorEl’s top-level document object, so it’s simply document.body most of the time.

The elevation of the popover.

This function is called in order to retrieve the content anchor element. It’s the opposite of the anchorEl prop. The content anchor element should be an element inside the popover. It’s used to correctly scroll and set the position of the popover. The positioning strategy tries to make the content anchor element just above the anchor element.

Specifies how close to the edge of the window the popover can appear.

Callback fired before the component is entering.

Callback fired when the component has entered.

Callback fired when the component is entering.

Callback fired before the component is exiting.

Callback fired when the component has exited.

Callback fired when the component is exiting.

If true, the popover is visible.

Props applied to the Paper element.

This is the point on the popover which will attach to the anchor’s origin.

Options: vertical: [top, center, bottom, x(px)]; horizontal: [left, center, right, x(px)].

The component used for the transition. Follow this guide to learn more about the requirements for this component.

Set to ‘auto’ to automatically calculate transition time based on height.

Props applied to the Transition element.

Demos:

API:

Properties
NameTypeDescription
action
custom

A ref for imperative actions. It currently only supports updatePosition() action.

anchorEl
custom

This is the DOM element, or a function that returns the DOM element, that may be used to set the position of the popover.

anchorOrigin
{"horizontal":"'center' | 'left' | 'right' | number","vertical":"'bottom' | 'center' | 'top' | number"}

This is the point on the anchor where the popover’s anchorEl will attach to. This is not used when the anchorReference is 'anchorPosition’.

Options: vertical: [top, center, bottom]; horizontal: [left, center, right].

anchorPosition
{"left":"number","top":"number"}

This is the position that may be used to set the position of the popover. The coordinates are relative to the application’s client area.

anchorReference
'anchorEl' | 'anchorPosition' | 'none'

This determines which anchor prop to refer to to set the position of the popover.

children
node

The content of the component.

classes
object

Override or extend the styles applied to the component. See CSS API below for more details.

className
string
container
function | React.Component | typeof Element === 'undefined' ? Object : Element

A node, component instance, or function that returns either. The container will passed to the Modal component. By default, it uses the body of the anchorEl’s top-level document object, so it’s simply document.body most of the time.

elevation
number

The elevation of the popover.

getContentAnchorEl
function

This function is called in order to retrieve the content anchor element. It’s the opposite of the anchorEl prop. The content anchor element should be an element inside the popover. It’s used to correctly scroll and set the position of the popover. The positioning strategy tries to make the content anchor element just above the anchor element.

marginThreshold
number

Specifies how close to the edge of the window the popover can appear.

onClose
function

Callback fired when the component requests to be closed.

onEnter
function

Callback fired before the component is entering.

onEntered
function

Callback fired when the component has entered.

onEntering
function

Callback fired when the component is entering.

onExit
function

Callback fired before the component is exiting.

onExited
function

Callback fired when the component has exited.

onExiting
function

Callback fired when the component is exiting.

open
(required)
bool

If true, the popover is visible.

PaperProps
{"component":"custom"}

Props applied to the Paper element.

transformOrigin
{"horizontal":"'center' | 'left' | 'right' | number","vertical":"'bottom' | 'center' | 'top' | number"}

This is the point on the popover which will attach to the anchor’s origin.

Options: vertical: [top, center, bottom, x(px)]; horizontal: [left, center, right, x(px)].

TransitionComponent
elementType

The component used for the transition. Follow this guide to learn more about the requirements for this component.

transitionDuration
'auto' | number | {"appear":"number","enter":"number","exit":"number"}

Set to ‘auto’ to automatically calculate transition time based on height.

TransitionProps
object

Props applied to the Transition element.

Help and resources