Navigation Menu
Navigation Menu
The navbar has five menus: Learn, Use, Build, Participate, and Solutions. All five are defined in one file, src/data/navbar.js. docusaurus.config.js spreads the result of that file into themeConfig.navbar.items, followed by the locale dropdown.
On desktop each menu opens as a mega panel with link columns and an optional featured tile. On mobile the same entries appear as a flat list in the drawer. Both views are derived from the same definition, so they cannot drift apart.
To add, move, or rename an entry: edit src/data/navbar.js, add the English translation keys (see Translation), then check the desktop panel and the mobile drawer.
Menu definition
Each menu is one megaMenu({label, featured, columns}) call:
megaMenu({
label: 'Use',
featured: {
title: 'Cardano Apps',
description: 'Explore curated applications built on Cardano.',
image: '/img/nav/use.webp',
to: '/apps',
cta: 'Explore apps',
placement: 'start',
},
columns: [
{
title: 'Get set up',
items: [
{to: '/wallets', label: 'Find a Wallet', description: 'Find the right wallet for you'},
{to: '/where-to-get-ada', label: 'Where to get ada?', description: 'Obtain ada to use Cardano'},
],
},
{
title: 'Do more',
items: [
// ...
],
},
],
}),
megaMenu returns a Docusaurus dropdown navbar item with mega: true, the full definition under customProps, and the flattened mobile list under items.
Items
Every link in a column is an object with these fields:
| Field | Required | Description |
|---|---|---|
label | yes | The link text. It is also the translation key, so changing the label creates a new key. |
to or href | one of the two | to for a site route, including anchors (/wallets, /governance#tools). href for an external URL (https://forum.cardano.org). |
description | no | One line shown under the label in the desktop panel. The mobile drawer drops it. |
Items have no icon or image. The only image in a menu is the featured tile.
Columns
A column is {title, items}. The title is rendered as the column heading. The panel adapts its width to the number of columns (data-columns on the menu item, styled in src/css/custom.css), three columns is the widest layout in use.
Featured tile
The optional featured object renders a large tile with an image, title, description, and call-to-action text:
| Field | Description |
|---|---|
title | Tile heading, also the translation key for the tile's strings |
description | One or two lines under the title |
image | Path under static/, the current tiles live in static/img/nav/<menu>.webp. Resolved with useBaseUrl, so the plain /img/... path works in every locale |
to or href | Link target, same rules as for items |
cta | Call-to-action text at the bottom of the tile |
placement | start puts the tile before the columns, end after them |
A menu without featured shows the columns only.