# SubMenuTrigger

Wraps a `Menu.Item` and a nested `Menu` to create hierarchical menus. Opens on hover or keyboard navigation (ArrowRight).

## When to Use

- Nested menu items
- Hierarchical menu structures
- Menus with sub-categories

## Properties

- **`placement`** `Placement` (default: `'right top'`) — Sub-menu position relative to trigger
- **`offset`** `number` (default: `4`) — Distance from trigger in pixels
- **`crossOffset`** `number` (default: `-5`) — Cross-axis offset in pixels
- **`shouldFlip`** `boolean` (default: `true`) — Flip when overflowing viewport
- **`containerPadding`** `number` — Minimum padding from viewport edges in pixels
- **`isDisabled`** `boolean` — Disable the trigger
- **`onAction`** `(key: Key) => void` — Callback when a sub-menu item is selected
- **`children`** `[ReactNode, ReactElement]` — Exactly two children: first is the trigger element (usually `Menu.Item`), second is the nested `Menu`
- **`autoFocus`** `boolean | 'first' | 'last'` (default: `'first'`) — Focus behavior when sub-menu opens

Extends React Aria `AriaMenuTriggerProps`.

### Base Properties

Supports [Base properties](../../BaseProperties.md).

### Style Properties

These properties allow direct style application without using the `styles` prop:

- **Base:** `display`, `font`, `preset`, `hide`, `whiteSpace`, `opacity`, `transition`
- **Position:** `gridArea`, `order`, `gridColumn`, `gridRow`, `placeSelf`, `alignSelf`, `justifySelf`, `zIndex`, `margin`, `inset`, `position`
- **Dimension:** `width`, `height`, `flexBasis`, `flexGrow`, `flexShrink`, `flex`
- **Block:** `border`, `radius`, `shadow`, `outline`, `padding`, `paddingInline`, `paddingBlock`, `overflow`, `scrollbar`, `textAlign`
- **Color:** `color`, `fill`, `fade`, `image`
- **Flow:** `flow`, `placeItems`, `placeContent`, `alignItems`, `alignContent`, `justifyItems`, `justifyContent`, `align`, `justify`, `gap`, `columnGap`, `rowGap`, `gridColumns`, `gridRows`, `gridTemplate`, `gridAreas`

## Examples

```jsx
<Menu>
  <Menu.Item key="edit">Edit</Menu.Item>
  <SubMenuTrigger>
    <Menu.Item key="more">More Options</Menu.Item>
    <Menu>
      <Menu.Item key="copy">Copy</Menu.Item>
      <Menu.Item key="move">Move</Menu.Item>
      <Menu.Item key="archive">Archive</Menu.Item>
    </Menu>
  </SubMenuTrigger>
  <Menu.Item key="delete">Delete</Menu.Item>
</Menu>
```
