You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/Overlay.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,8 @@ See the [W3C accessibility recommendations for modals](https://www.w3.org/TR/wai
76
76
77
77
`Overlay` renders its `children` within a div positioned absolutely within a portal within the default portal root. The overlay will not update its positioning if the portal root's positioning changes (e.g., if the portal root is statically positioned after some DOM element that dynamically resizes). You may consider using the [AnchoredOverlay](/AnchoredOverlay) component or [customizing the portal root](/Portal#customizing-the-portal-root) to achieve different positioning behavior.
78
78
79
+
The position of the Overlay can be customized by using the `position` prop in conjunction with the `top|left|right|bottom` props.
Copy file name to clipboardExpand all lines: src/Overlay.tsx
+21-6Lines changed: 21 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -94,8 +94,11 @@ type BaseOverlayProps = {
94
94
onEscape: (e: KeyboardEvent)=>void
95
95
visibility?: 'visible'|'hidden'
96
96
'data-test-id'?: unknown
97
-
top?: number
98
-
left?: number
97
+
position?: React.CSSProperties['position']
98
+
top?: React.CSSProperties['top']
99
+
left?: React.CSSProperties['left']
100
+
right?: React.CSSProperties['right']
101
+
bottom?: React.CSSProperties['bottom']
99
102
portalContainerName?: string
100
103
preventFocusOnOpen?: boolean
101
104
role?: AriaRole
@@ -117,8 +120,11 @@ type OwnOverlayProps = Merge<StyledOverlayProps, BaseOverlayProps>
117
120
* @param height Sets the height of the `Overlay`, pick from our set list of heights, or pass `auto` to automatically set the height based on the content of the `Overlay`, or pass `initial` to set the height based on the initial content of the `Overlay` (i.e. ignoring content changes). `xsmall` corresponds to `192px`, `small` corresponds to `256px`, `medium` corresponds to `320px`, `large` corresponds to `432px`, `xlarge` corresponds to `600px`.
118
121
* @param maxHeight Sets the maximum height of the `Overlay`, pick from our set list of heights. `xsmall` corresponds to `192px`, `small` corresponds to `256px`, `medium` corresponds to `320px`, `large` corresponds to `432px`, `xlarge` corresponds to `600px`.
119
122
* @param anchorSide If provided, the Overlay will slide into position from the side of the anchor with a brief animation
120
-
* @param top Optional. Vertical position of the overlay, relative to its closest positioned ancestor (often its `Portal`).
121
-
* @param left Optional. Horizontal position of the overlay, relative to its closest positioned ancestor (often its `Portal`).
123
+
* @param top Optional. Vertical top position of the overlay, relative to its closest positioned ancestor (often its `Portal`).
124
+
* @param left Optional. Horizontal left position of the overlay, relative to its closest positioned ancestor (often its `Portal`).
125
+
* @param right Optional. Horizontal right position of the overlay, relative to its closest positioned ancestor (often its `Portal`).
126
+
* @param bottom Optional. Vertical bottom position of the overlay, relative to its closest positioned ancestor (often its `Portal`).
127
+
* @param position Optional. Sets how an element is positioned in a document. Defaults to `absolute` positioning.
122
128
* @param portalContainerName Optional. The name of the portal container to render the Overlay into.
0 commit comments