# swc-menu

A menu is a list of actions or options anchored to an externally-referenced trigger, following the menu-button pattern.

```js
import '@adobe/spectrum-wc/components/menu/index.js';
// <swc-menu></swc-menu>
```

## Attributes

| Name          | Type                  | Default          | Description                                                                                                            |
| ------------- | --------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `size`        | `ElementSize`         | -                |                                                                                                                        |
| `for`         | `string \| undefined` | -                | The `id` of the trigger element in the same document tree root.                                                        |
| `placement`   | `MenuPlacement`       | `'bottom-start'` | Where the anchored surface opens relative to the trigger, and its cross-axis alignment against it.                     |
| `should-flip` | `boolean`             | `true`           | Whether the surface may reposition to the opposite side when the requested direction does not fit within the viewport. |
| `open`        | `boolean`             | `false`          | Whether the menu is open.                                                                                              |

## Slots

| Name        | Description               |
| ----------- | ------------------------- |
| `(default)` | `swc-menu-item` elements. |

## Events

| Name              | Description                                      |
| ----------------- | ------------------------------------------------ |
| `swc-open`        | Dispatched when the menu begins opening.         |
| `swc-after-open`  | Dispatched after the open transition completes.  |
| `swc-close`       | Dispatched when the menu begins closing.         |
| `swc-after-close` | Dispatched after the close transition completes. |
