Popup
A popup displays brief content in an overlay.Installation
| Install | yarn add @atlaskit/popup |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/popup, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
| Description | The "default" appearance is used for standard popups. The "UNSAFE_modal-below-sm" appearance makes the popup appear as a modal when the viewport is smaller than "sm". |
|---|---|
| Type | "default" | "UNSAFE_modal-below-sm" |
| Description | This controls whether the popup takes focus when opening.
This changes the |
|---|---|
| Type | boolean |
| Description | The boundary element that the popup will check for overflow.
The default is @private
No-op when |
|---|---|
| Type | HTMLElement | "clippingParents" |
| Description | Render props for content that is displayed inside the popup. |
|---|---|
| Type | (props: ContentProps) => ReactNode |
| Description | This is a list of backup placements for the popup to try. When the preferred placement doesn't have enough space, the modifier will test the ones provided in the list, and use the first suitable one. If no fallback placements are suitable, it reverts back to the original placement. @private
No-op when |
|---|---|
| Type | Placement[] |
| Description | ID that is assigned to the popup container element. |
|---|---|
| Type | string |
| Description | Use this to either show or hide the popup.
When set to |
|---|---|
| Type | boolean |
| Description | Refers to an |
|---|---|
| Type | string |
| Description | Additional modifiers and modifier overwrites. for more details - https://popper.js.org/docs/v1/#modifiers |
|---|---|
| Type | Partial<Partial<Modifier<string, object>>>[] |
| Description | The distance the popup should be offset from the reference in the format of [along, away] (units in px).
The default is @private
Note: when |
|---|---|
| Type | [number, number] |
| Description | Handler that is called when the popup wants to close itself. This can happen when:
You'll want to use this to set open state accordingly, and then pump it back into the |
|---|---|
| Type | (event: Event | MouseEvent<Element, globalThis.MouseEvent> | KeyboardEvent<Element>, currentLevel?: any) => void |
| Description | Placement of where the popup should be displayed relative to the trigger element.
The default is |
|---|---|
| Type | AutoPlacement | BasePlacement | VariationPlacement |
| Description | The element that is shown when |
|---|---|
| Type | ComponentType<PopupComponentProps> | ForwardRefExoticComponent<PopupComponentProps & RefAttributes<HTMLDivElement>> |
| Description | Use this to set the accessibility role for the popup.
We strongly recommend using only |
|---|---|
| Type | string |
| Description | The root boundary that the popup will check for overflow.
The default is @private
No-op when |
|---|---|
| Type | "viewport" | "document" |
| Description | This makes the popup close on Tab key press. It will only work when @private
No-op when |
|---|---|
| Type | boolean |
| Description | This fits the popup width to its parent's width.
When set to This fits the popup width to its parent's width.
When set to |
|---|---|
| Type | boolean |
| Description | Determines if the popup will have a |
|---|---|
| Type | boolean |
| Description | Allows the popup to be placed on the opposite side of its trigger if it doesn't fit in the viewport.
The default is @private
No-op when |
|---|---|
| Type | boolean |
| Description | Allows consumers to ignore specific close events, for example when an external overlay should be treated as part of the popup interaction. |
|---|---|
| Type | (event: Event | MouseEvent<Element, globalThis.MouseEvent> | KeyboardEvent<Element>) => boolean |
| Description | The root element where the popup should be rendered.
Defaults to @private
No-op when @private
@deprecated No-op when |
|---|---|
| Type | boolean |
| Description | This determines whether the popup trigger will be focused when the popup content closes.
The default is |
|---|---|
| Type | boolean |
| Description | This controls if the event which handles clicks outside the popup is be bound with
|
|---|---|
| Type | boolean |
| Description | This controls the positioning strategy to use. Can vary between @private
No-op when @private
@deprecated No-op when |
|---|---|
| Type | "fixed" | "absolute" |
| Description | A |
|---|---|
| Type | string |
| Description | Id referenced by the popup |
|---|---|
| Type | string |
| Description | Render props used to anchor the popup to your content.
Make this an interactive element,
such as an |
|---|---|
| Type | (props: TriggerProps) => ReactNode |
| Description | Bounded style overrides. |
|---|---|
| Type | false | (XCSSValue<"width" | "paddingBlockEnd" | "paddingBlockStart" | "paddingInlineEnd" | "paddingInlineStart" | "padding" | "paddingBlock" | "paddingInline", DesignTokenStyles, ""> & ... 4 more ... & { ...; }) |
| Description | Z-index that the popup should be displayed in. This is passed to the portal component. The default is 400. @private
No-op when |
|---|---|
| Type | number |