New to KendoReactStart a free 30-day trial

Definition

Package:@progress/kendo-react-layout

Properties

animate?

boolean | PopupAnimation

Controls the Popup animation.

Default:

true

Example:
jsx
<Menu animate={{ openDuration: 200, closeDuration: 200 }} />

children?

ReactNode

Sets the Menu items declaratively.

Example:
jsx
<Menu>
  <MenuItem text="Item 1" />
  <MenuItem text="Item 2" />
</Menu>

Adds a custom className to the Menu top element.

Example:
jsx
<Menu className="custom-menu" />

Sets the ids of the Menu items that will not be closed on mouse-leave. The ids are hierarchical and zero-based. The first root item has a 0 id. If the first root item has children, the first child item acquires a 0_0 id and the second acquires a 0_1 id.

Example:
jsx
<Menu customCloseItemIds={['0', '0_1']} />

dir?

string

Sets the direction of the Menu.

Example:
jsx
<Menu dir="rtl" />

id?

string

Sets the ID of the Menu.

Example:
jsx
<Menu id="custom-menu" />

A React functional or class component which is used for rendering the innermost part of the Menu item (see example). By default, the innermost item part includes only the text for the item.

Example:
jsx
const CustomItem = (props) => <div>{props.text}</div>;
<Menu itemRender={CustomItem} />

Sets the Menu items.

Example:
jsx
const items = [{ text: 'Item 1' }, { text: 'Item 2' }];
<Menu items={items} />

A React functional or class component which is used for rendering the link of the item (see example). The item link is a part of the visual representation of the item which, by default, includes an arrow, icon, and text.

Example:
jsx
const CustomLink = (props) => <a href={props.href}>{props.text}</a>;
<Menu linkRender={CustomLink} />

offset

Offset

Specifies the absolute position of the ContextMenu. The Popover opens next to that point.

Example:

jsx
<ContextMenu offset={{ left: 100, top: 200 }} />

onClose

(event: MenuCloseEvent) => void

Triggers when the ContextMenu needs to hide.

Example:

jsx
<ContextMenu onClose={(e) => setShow(false)} />
Parameters:eventMenuCloseEvent

onSelect?

(event: MenuSelectEvent) => void

Fires when a Menu item is selected.

Parameters:eventMenuSelectEvent
Example:
jsx
<Menu onSelect={(event) => console.log(event.item.text)} />

show

boolean

Controls the Popup visibility of the ContextMenu.

Example:

jsx
<ContextMenu show={true} />

style?

CSSProperties

Sets additional CSS styles to the Menu.

Example:
jsx
<Menu style={{ backgroundColor: 'lightblue' }} />

vertical?

boolean

Specifies whether the Menu will be vertical (see example).

Default:

false

Example:
jsx
<Menu vertical />

webMcp?

boolean | WebMcpProps

Enables Web MCP tool registration for this component. Requires a parent WebMcpProvider from @progress/kendo-react-webmcp.