Skip to content

Commit 016562b

Browse files
committed
[menu] Show root positioner defaults
1 parent 8e83795 commit 016562b

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

docs/src/app/(docs)/react/components/context-menu/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Renders a `<div>` element.
198198
| disableAnchorTracking | `boolean` | `false` | Whether to disable the popup from tracking any layout shift of its positioning anchor. |
199199
| align | `Align` | `'start'` | How to align the popup relative to the specified side. |
200200
| alignOffset | `number \| OffsetFunction` | - | Additional offset along the alignment axis in pixels.&#xA;Also accepts a function that returns the offset to read the dimensions of the anchor&#xA;and positioner elements, along with its side and alignment. The function takes a `data` object parameter with the following properties: `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.`data.positioner`: the dimensions of the positioner element with properties `width` and `height`.`data.side`: which side of the anchor element the positioner is aligned against.`data.align`: how the positioner is aligned relative to the specified side. Defaults to `2` for root context menus when `side` is not specified and `align` is not&#xA;`'center'`. Otherwise, it defaults to `0`. |
201-
| side | `Side` | - | Which side of the anchor element to align the popup against.&#xA;May automatically change to avoid collisions. Defaults to `'bottom'` for root context menus and to `'inline-end'` for submenus. |
201+
| side | `Side` | `'bottom'` | Which side of the anchor element to align the popup against.&#xA;May automatically change to avoid collisions. Submenus default to `'inline-end'`. |
202202
| sideOffset | `number \| OffsetFunction` | - | Distance between the anchor and the popup in pixels.&#xA;Also accepts a function that returns the distance to read the dimensions of the anchor&#xA;and positioner elements, along with its side and alignment. The function takes a `data` object parameter with the following properties: `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.`data.positioner`: the dimensions of the positioner element with properties `width` and `height`.`data.side`: which side of the anchor element the positioner is aligned against.`data.align`: how the positioner is aligned relative to the specified side. Defaults to `-5` for root context menus when `side` is not specified and `align` is not&#xA;`'center'`. Otherwise, it defaults to `0`. |
203203
| arrowPadding | `number` | - | Minimum distance to maintain between the arrow and the edges of the popup. Root context menus always use `0`. Submenus default to `5`. |
204204
| anchor | `Element \| VirtualElement \| React.RefObject<Element \| null> \| (() => Element \| VirtualElement \| null) \| null` | - | An element to position the popup against.&#xA;By default, root context menus are positioned at the pointer, and submenus are positioned&#xA;against their trigger. |

0 commit comments

Comments
 (0)