Envisioning LogoEnvisioning App (1.0.3)
Configuration

Menu

Configure the sidebar navigation menu

Overview

The menu array defines the sidebar navigation structure. Each menu item links to a page and displays an icon and label.

import type { Config } from "@envisioning/app";

const menu: Config["navigation"]["menu"] = [
  {
    id: "home",
    label: { en: "Home" },
    icon: "homeEv",
    pageId: "home",
  },
  {
    id: "techs",
    label: { en: "Technologies" },
    icon: "circlesGroup3Ev",
    pageId: "technologies",
  },
];

Properties Reference

PropertyTypeRequiredDescription
idstringYesUnique identifier for the menu item
labelI18nYesDisplay label (supports internationalization)
iconIconNameYesIcon name from the icon library
pageIdstringYesID of the page this menu item links to

Each menu item connects to a page. The pageId must match a page's id in the pages array, and the page's menuId should reference this menu item.

// Menu item
{
  id: "techs",
  label: { en: "Technologies" },
  icon: "circlesGroup3Ev",
  pageId: "technologies",
}

// Corresponding page
{
  id: "technologies",
  menuId: "techs",  // References the menu item
  label: { en: "Technologies" },
  // ...
}

Using Schema Labels

You can reference schema labels directly for dynamic menu labels:

import { schema } from "./schema";

const menu: Config["navigation"]["menu"] = [
  {
    id: "techs",
    label: schema.objects.entities.plural,  // Uses "Technologies" from schema
    icon: "circlesGroup3Ev",
    pageId: "technologies",
  },
  {
    id: "collections",
    label: schema.objects.collection.plural,  // Uses "Collections" from schema
    icon: "box",
    pageId: "collections",
  },
];

Available Icons

Common icons used in menus:

Icon NameUse Case
homeEvHome page
circlesGroup3EvEntity lists
boxCollections/clusters
gaugeMetrics
infoAbout page
shieldTags
milestoneCategories

See the Icons documentation for the complete list.


Complete Example

import type { Config } from "@envisioning/app";
import { schema } from "./schema";

const menu: Config["navigation"]["menu"] = [
  {
    id: "home",
    label: { en: "Home" },
    icon: "homeEv",
    pageId: "home",
  },
  {
    id: "techs",
    label: schema.objects.entities.plural,
    icon: "circlesGroup3Ev",
    pageId: "technologies",
  },
  {
    id: "collections",
    label: schema.objects.collection.plural,
    icon: "box",
    pageId: "collections",
  },
  {
    id: "metrics",
    label: { en: "Metrics" },
    icon: "gauge",
    pageId: "metrics",
  },
  {
    id: "about",
    label: { en: "About" },
    icon: "info",
    pageId: "about",
  },
];

export const navigation: Config["navigation"] = {
  menu,
  pages,
  blocks,
};

Validation

The configuration validates that:

  1. Each pageId in menu items exists in the pages array
  2. Each page's menuId exists in the menu array

If validation fails, you'll see helpful error messages:

Page "technologies" not found in pages
MenuItem "techs" not found in menuItems. Check page "technologies"

On this page