Skip to content
Child component of Menu

Overview

Menu Item components represent an option a user can select from a Menu. Through the use of text and iconography, Menu Item components can convey a current location or target destination within an application.

API reference

Properties

PropertyAttributeDescriptionTypeDefault
activeactiveWhen true, the component is highlighted.booleanfalse
breadcrumbbreadcrumbWhen true, the component displays a breadcrumb trail for use as a navigational aid.booleanfalse
hrefhrefSpecifies the URL destination of the component, which can be set as an absolute or relative path.string
iconEndicon-endSpecifies an icon to display at the end of the component.IconName
iconFlipRtlicon-flip-rtlDisplays the iconStart and/or iconEnd as flipped when the element direction is right-to-left ("rtl").FlipContext
iconStarticon-startSpecifies an icon to display at the start of the component.IconName
labelrequiredlabelSpecifies an accessible label for the component.string
messageOverridesOverrides individual strings used by the component.Record<string, unknown> | undefined
openopenWhen true, the component will display any slotted calcite-menu-item in an open overflow menu.booleanfalse
relrelDefines the relationship between the href value and the current document.string
targettargetSpecifies where to open the linked document defined in the href property.string
texttextSpecifies the text to display.string

Slots

NameDescription
submenu-itemA slot for adding calcite-menu-items in a submenu.

Styles

NameDescription
--calcite-menu-item-accent-colorWhen active, specifies the component's border color.
--calcite-menu-background-colorSpecifies the component's background color.
--calcite-menu-item-sub-menu-border-colorSpecifies the submenu's border color.
--calcite-menu-item-sub-menu-corner-radiusSpecifies the submenu's border radius.
--calcite-menu-text-colorSpecifies the component's text color.

Events

NameDescriptionBehavior
calciteMenuItemSelectEmits when the component is selected.bubblescomposedcancelable

Methods

NameDescriptionSignature
componentOnReadyCreate a promise that resolves once component is fully loaded.componentOnReady(): Promise<this>
setFocusSets focus on the component.setFocus(options?: FocusOptions): Promise<void>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.