# MenuItem

> MenuItem entity - components, queries, links, and related actions

Your storefront encounters the **MenuItem** entity when building site navigation: header menus, footer links, sidebar navigation, or any structured link tree managed through your commerce backend. Each MenuItem represents a single entry in a navigation menu and can be either a link pointing to a URL or a folder that groups child items.

**Entity: MenuItem**

Components: base

## Components

### Base

Label, optional URL link, and parent/child references for nesting menu items into a tree structure. Each item is typed as either (navigable URL) or (grouping container for children).

### MenuItemBase `base`

```ts
import { MenuItemBase } from '@laioutr-core/canonical-types/entity/menuItem';
```

#### Schema

```json
{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"type":"object","properties":{"name":{"$ref":"#/definitions/__schema0"},"childIds":{"$ref":"#/definitions/__schema1"},"parentId":{"$ref":"#/definitions/__schema2"},"type":{"type":"string","const":"link"},"link":{"$ref":"#/definitions/Link"}},"required":["name","type","link"],"additionalProperties":false},{"type":"object","properties":{"name":{"$ref":"#/definitions/__schema0"},"childIds":{"$ref":"#/definitions/__schema1"},"parentId":{"$ref":"#/definitions/__schema2"},"type":{"type":"string","const":"folder"}},"required":["name","type"],"additionalProperties":false}],"id":"entity:MenuItem:base","definitions":{"__schema0":{"type":"string"},"__schema1":{"type":"array","items":{"type":"string"}},"__schema2":{"type":"string"},"Link":{"description":"A link to an internal or external page. Links can be of different types for different link-targets.","id":"Link","anyOf":[{"$ref":"#/definitions/LinkReference"},{"$ref":"#/definitions/LinkUrl"},{"$ref":"#/definitions/LinkPage"},{"$ref":"#/definitions/LinkAnchor"},{"$ref":"#/definitions/LinkPageType"}]},"LinkReference":{"description":"Link to a entity-detail-page.","id":"LinkReference","type":"object","properties":{"type":{"type":"string","const":"reference"},"query":{"$ref":"#/definitions/__schema3"},"reference":{"type":"object","properties":{"type":{},"slug":{"type":"string"},"id":{"type":"string"}},"required":["type","slug"],"additionalProperties":false}},"required":["type","reference"],"additionalProperties":false},"__schema3":{"type":"object","propertyNames":{"anyOf":[{"type":"string"},{"type":"number"}]},"additionalProperties":{"anyOf":[{"$ref":"#/definitions/__schema4"},{"type":"array","items":{"$ref":"#/definitions/__schema4"}}]}},"__schema4":{"description":"As we use vue-router, we need to adhere to its supported query types: https://router.vuejs.org/api/type-aliases/LocationQueryRaw.html","anyOf":[{"type":"string"},{"type":"number"},{"type":"null"}]},"LinkUrl":{"description":"Link to a given url directly.","id":"LinkUrl","type":"object","properties":{"type":{"type":"string","const":"url"},"query":{"$ref":"#/definitions/__schema3"},"href":{"type":"string"},"target":{"type":"string","enum":["_blank"]}},"required":["type","href"],"additionalProperties":false},"LinkPage":{"description":"Link to a specific page by its ID.","id":"LinkPage","type":"object","properties":{"type":{"type":"string","const":"page"},"query":{"$ref":"#/definitions/__schema3"},"page":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"params":{"allOf":[{"$ref":"#/definitions/__schema5"}]}},"required":["type","page"],"additionalProperties":false},"__schema5":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"LinkAnchor":{"description":"Link to an anchor on the current page","id":"LinkAnchor","type":"object","properties":{"type":{"type":"string","const":"anchor"},"query":{"$ref":"#/definitions/__schema3"},"fragment":{"description":"Does _not_ contain the hash (#) prefix. See https://url.spec.whatwg.org/#concept-url-fragment","type":"string"}},"required":["type","fragment"],"additionalProperties":false},"LinkPageType":{"description":"Link to a page of a certain type. It's not guaranteed that a page of this type exists.","id":"LinkPageType","type":"object","properties":{"type":{"type":"string","const":"pageType"},"query":{"$ref":"#/definitions/__schema3"},"pageType":{"type":"string"},"params":{"allOf":[{"$ref":"#/definitions/__schema5"}]},"subject":{"type":"object","properties":{"type":{},"id":{"type":"string"}},"required":["type","id"],"additionalProperties":false}},"required":["type","pageType"],"additionalProperties":false}}}
```

## Queries

- [MenuByAliasQuery](/frontend/api-reference/ecommerce/queries#menu) - Retrieve all menu items belonging to a menu identified by its alias.

## Related Entities

- [Product](/frontend/api-reference/entities/product) - Products that menu items may link to.
- [Category](/frontend/api-reference/entities/category) - Categories that menu items may link to.
