Skip to main content

Component

The component prop allows you to change the wrapper component of a menu item. The component prop accepts either a string or a ReactElement. If you pass a string, it will be used as the HTML tag for the wrapping component. If you pass a ReactElement, it will be rendered as the wrapping component itself; for example, <Link> component from a routing library.

Props

component?: string | ReactElement
Default Value
component = <a></a>;

Example

/horizontal-menu/menu-item/component

Source Code