Introduction
One of the highlights of a good admin application is to ensure that it is well-positioned and that navigation is simple. To control navigation in the VTEX admin side menu there are two files that will be useful: navigation.json androutes.json.
navigation.json
Navigation is the file that defines the navigation rules in the VTEX admin sidebar. With it, you can build from a simpler link, in which a click takes you to your app, how to build more complex menus with associated submenus.

routes.json
The routes define the routes and associated react components, from your application, any component that is mapped to a route must be declared in the routes, even if it is not directly associated with a navigation item in navigation.json.
Atividade
- Within the
/admin/folder created in the previous step, create two more files,navigation.jsonandroutes.json:
_10|_ admin/_10+ |_ navigation.json_10+ |_ routes.json
- In
navigation.jsoncreate a JSON object with the propertiessection,titleIdandpath:
_10{_10 "section": "orders",_10 "titleId": "admin-example.navigation.label",_10 "path": "/admin/iotraining"_10}
- In
routes.jsonassign acomponentandpathto the created navigation:
_10{_10 "admin.app.example": {_10 "component": "adminExample",_10 "path": "/admin/app/iotraining"_10 }_10}
NOTE: The mapping from a navigation to a route is done through the path. The path must diverge only by a /app/ in routes.json
_10//navigation.json_10_10/admin/{{yourpath}}_10_10//routes.json_10_10/admin/app/{{yourpath}}
- Finally, create a simple hello world component with the same name that you gave to
componentinroutes.json:
_10//react/adminExample.tsx_10import React, { FC } from 'react'_10_10const AdminExample: FC = () => {_10 return <h1>Hello, World!</h1>_10}_10_10export default AdminExample
Link the application (vtex link). The result should be as follows:
