# MenuSub
A submenu trigger that opens a nested menu list inside a parent menu.
## Usage
Use inside `MenuList` to trigger a nested `MenuList`.
```svelte
```
## Anatomy
The `class` attribute values represent part names. Other attributes represent their corresponding props.
```svelte
{children}
```
Provides `MenuContainerContext` to its nested `MenuList`, labels that submenu from the trigger, opens on click, hover, Enter, Space, and the forward arrow for the parent menu orientation, and closes one level on Escape or the back arrow. Hover uses a per-level safe triangle while moving toward the submenu. Hover-opening focuses the submenu's first enabled item through `MenuList`'s existing open effect.
## Props
| Name | Type | Default | Description |
|---|---|---|---|
| `children*` | `Snippet` | - | Must render the submenu's `MenuList`; receives the variant as its argument |
| `label*` | `string` / `Snippet` | - | Trigger content; a snippet receives the variant as its argument |
| `open` | `boolean` | `false` | Bindable open state; observable, not a positioning control |
| `disabled` | `boolean` | `false` | Sets `aria-disabled`, skips menu navigation, and prevents opening |
| `attach` | `Attachment` | - | Svelte attachment on the trigger |
| `element` | `HTMLButtonElement` | - | Bindable trigger element |
| `styling` | `SVSClass` | - | Styling override |
| `variant` | `SVSVariant` | `NEUTRAL` | Submenu variant |
`*` required. Other button attributes are passed to the trigger via rest props; `class` is merged onto the trigger.
## Styling
To learn more, see [Styling](/docs/styling).
### Variant Management
No automatic switching. Inside a `MenuList`, `variant` and `styling` fall back to the parent menu's via context.
### Default Class Name
`svs-menu-sub`
## Behavior
Provides `MenuContainerContext` to its nested `MenuList` and labels that submenu from the trigger. It opens on click, hover, `Enter`, `Space`, and the forward arrow for the parent menu's orientation, and closes one level on `Escape` or the back arrow.
Hover uses a per-level safe triangle while the pointer moves toward the submenu. Hover-opening focuses the submenu's first enabled item through `MenuList`'s existing open effect.
## Accessibility
### Keyboard Interactions
| Key | Description |
| --- | --- |
| `Enter` / `Space` | Toggles the submenu |
| `ArrowRight` / `ArrowDown` | Opens the submenu; `ArrowRight` in a vertical menu, `ArrowDown` in a horizontal one |
| `ArrowLeft` / `ArrowUp` | Closes the submenu and returns focus to the trigger; `ArrowLeft` in a vertical menu, `ArrowUp` in a horizontal one |
| `Escape` | Closes the submenu, returning focus to the trigger |
For item navigation and type-ahead, see [MenuList](/docs/menu-list).
### ARIA Roles and Attributes
The component applies these automatically:
- Trigger (`main` `