# MenuItemArgs

Interface · extends [`ContainerArgs`](https://api.playcanvas.com/pcui/interfaces/ContainerArgs.md)

Source: https://github.com/playcanvas/pcui/blob/77ed2b8ba8660c9644049b0d1942652721e7a6c4/src/components/MenuItem/index.ts#L18

The arguments for the [MenuItem](https://api.playcanvas.com/pcui/classes/MenuItem.md) constructor.

## Properties

### hasChildren

```ts
hasChildren?: boolean
```

Whether the MenuItem has any child MenuItems.

### icon

```ts
icon?: string
```

Sets the CSS code for an icon for the MenuItem. e.g. 'E401' (notice we omit the '\\' character).

### items

```ts
items?: MenuItemArgs[]
```

An array of MenuItem constructor data. If defined then child MenuItems will be created and added to the MenuItem.

### menu

```ts
menu?: Menu
```

Sets the parent Menu Element.

### onIsEnabled

```ts
onIsEnabled?: () => boolean
```

Sets the function that determines whether the MenuItem should be enabled when the Menu is shown.

### onIsVisible

```ts
onIsVisible?: () => boolean
```

Sets the function that determines whether the MenuItem should be visible when the Menu is shown.

### onSelect

```ts
onSelect?: (evt?: MouseEvent) => void
```

Sets the function called when we select the MenuItem.

### shortcut

```ts
shortcut?: string
```

Sets the keyboard shortcut to display on the MenuItem (e.g., 'Ctrl+C').

### text

```ts
text?: string
```

Sets the text shown on the MenuItem.

## Inherited from [ContainerArgs](https://api.playcanvas.com/pcui/interfaces/ContainerArgs.md)

- `alignItems?: string`
- `alignSelf?: string`
- `binding?: BindingBase`
- `children?: ReactNode`
- `class?: string | string[]`
- `dom?: string | HTMLElement`
- `enabled?: boolean`
- `error?: boolean`
- `flex?: boolean`
- `flexBasis?: string | number`
- `flexDirection?: string`
- `flexGrow?: string | number`
- `flexShrink?: string | number`
- `flexWrap?: string`
- `grid?: boolean`
- `height?: number`
- `hidden?: boolean`
- `id?: string`
- `ignoreParent?: boolean`
- `isRoot?: boolean`
- `justifyContent?: string`
- `justifySelf?: string`
- `link?: { observer: Observer | Observer[]; path: string | string[] }`
- `onChange?: (value: unknown) => void`
- `onClick?: () => void`
- `onRemove?: () => void`
- `onResize?: () => void`
- `parent?: Element`
- `readOnly?: boolean`
- `resizable?: string`
- `resizeMax?: number`
- `resizeMin?: number`
- `scrollable?: boolean`
- `style?: string`
- `tabIndex?: number`
- `width?: number`
