
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@o2xp/react-menu
Advanced tools
@o2xp/menu-react is a modulable component to render a menu for your application. You can have as much nested level as you want, we use recursivity to build it.
@o2xp/menu-react is a modulable component to render a menu for your application. You can have as much nested level as you want, we use recursivity to build it.
You need to use react-router-dom as routeur for your project.
$ npm i --save @o2xp/menu-react
In your file
// ES6
import {Menu} from '@o2xp/menu-react';
let data = {
title: "My menu",
user: "morgan.dubois",
server: "localhost:8072",
menuItems: [
{
label: "Home",
path: "/",
icon: <HomeIcon/>
},
{
label: "Trades",
path: "/trades",
icon : <SwapHorizIcon/>
},
{
label: "Ref Data",
path: "/ref-data",
icon: <ListIcon/>,
subMenuItems: [
{
label: "Currencies",
path: "/ref-data/currencies",
icon: <OfflineBoltIcon/>,
subMenuItems: [
{
label: "Europe",
path: "/ref-data/currencies/europe",
icon: <ExtensionIcon/>
},
{
label: "US",
path: "/ref-data/currencies/us",
icon: <RoomIcon/>
}
]
},
{
label: "Spot Dates",
path: "/ref-data/spot-dates",
icon: <DateRangeIcon/>
}
]
}
]
}
In your render function :
<Menu title={data.title} user={data.user} server={data.server} menuItems={data.menuItems}/>
A complete basic running example can be found here.
| Property | Type | Required? | Description |
|---|---|---|---|
| title | string | yes | Title of the menu. |
| user | string | yes | Name of the user |
| server | string | yes | Name of the server |
| menuItems | array of object | yes | An array of object with these properties label (name of the category), path (path of the category), icon (icon of the category) and as optional subMenuItems which is the same nested object as himself. (see example just ahead) |
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.