{
 "id": "sidebar-nav",
 "name": "Sidebar navigation",
 "purpose": "The left rail of a work app: workspace switcher, search with a shortcut, grouped pages with counts, a collapsible group and the signed-in person.",
 "use_when": [
  "as the main navigation of a work app",
  "a desktop work app with several sections and more than one workspace or team"
 ],
 "avoid_when": [
  "fewer than five pages, or a consumer phone app: use a bottom tab bar or page-header-tabs",
  "finding any page or action by typing: use command-menu, opened from this rail's search button",
  "tabs inside one page: use page-header-tabs"
 ],
 "type": "navigation",
 "style": "quiet",
 "width": "narrow",
 "tags": {
  "audience": "work",
  "industries": [
   "saas",
   "finance",
   "any"
  ],
  "keywords": [
   "sidebar",
   "navigation",
   "workspace switcher",
   "nav rail",
   "menu"
  ]
 },
 "root": ".odl-sidebar-nav",
 "parts": [
  {
   "name": "switcher",
   "selector": ".odl-switcher",
   "what": "workspace button: a letter mark, the workspace name and its plan or size",
   "slot": "action"
  },
  {
   "name": "search",
   "selector": ".odl-search",
   "what": "search button with its shortcut keys",
   "slot": "action"
  },
  {
   "name": "headings",
   "selector": ".odl-heading",
   "what": "a section heading such as Payables",
   "slot": "list"
  },
  {
   "name": "items",
   "selector": ".odl-item",
   "what": "one page link: icon, label and an optional count; the current page is raised",
   "slot": "list"
  },
  {
   "name": "count",
   "selector": ".odl-count",
   "what": "a number beside a page; is-new makes it an accent pill",
   "slot": "number"
  },
  {
   "name": "group",
   "selector": "details > summary",
   "what": "a collapsible section heading",
   "slot": "text"
  },
  {
   "name": "person",
   "selector": ".odl-person",
   "what": "the signed-in person: photo with an online dot, name and role",
   "slot": "action"
  },
  {
   "name": "avatar",
   "selector": ".odl-avatar img",
   "what": "the person's photo",
   "slot": "media"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "sections"
  ],
  "properties": {
   "workspace": {
    "type": "object",
    "part": "switcher",
    "required": [
     "name"
    ],
    "properties": {
     "name": {
      "type": "string",
      "maxLength": 32
     },
     "detail": {
      "type": "string",
      "maxLength": 28
     },
     "initial": {
      "type": "string",
      "maxLength": 2
     }
    }
   },
   "search_label": {
    "type": "string",
    "maxLength": 16,
    "part": "search"
   },
   "shortcut": {
    "type": "string",
    "maxLength": 6,
    "part": "search"
   },
   "sections": {
    "type": "array",
    "minItems": 1,
    "maxItems": 5,
    "part": "headings",
    "items": {
     "type": "object",
     "required": [
      "items"
     ],
     "properties": {
      "heading": {
       "type": "string",
       "maxLength": 20
      },
      "collapsible": {
       "type": "boolean"
      },
      "open": {
       "type": "boolean"
      },
      "items": {
       "type": "array",
       "minItems": 1,
       "maxItems": 8,
       "items": {
        "type": "object",
        "required": [
         "label",
         "href"
        ],
        "properties": {
         "label": {
          "type": "string",
          "maxLength": 22
         },
         "href": {
          "type": "string",
          "maxLength": 200
         },
         "icon": {
          "type": "string",
          "maxLength": 32
         },
         "count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 999
         },
         "count_label": {
          "type": "string",
          "maxLength": 24
         },
         "new": {
          "type": "boolean"
         },
         "current": {
          "type": "boolean"
         }
        }
       }
      }
     }
    }
   },
   "person": {
    "type": "object",
    "part": "person",
    "required": [
     "name"
    ],
    "properties": {
     "name": {
      "type": "string",
      "maxLength": 28
     },
     "detail": {
      "type": "string",
      "maxLength": 28
     },
     "photo": {
      "type": "string",
      "maxLength": 300
     }
    }
   },
   "workspace_initial": {
    "type": "string",
    "maxLength": 80
   },
   "workspace_name": {
    "type": "string",
    "maxLength": 80
   },
   "workspace_detail": {
    "type": "string",
    "maxLength": 80
   },
   "person_photo": {
    "type": "object",
    "required": [
     "src",
     "alt"
    ],
    "properties": {
     "src": {
      "type": "string",
      "maxLength": 2048
     },
     "alt": {
      "type": "string",
      "maxLength": 200
     }
    }
   },
   "person_name": {
    "type": "string",
    "maxLength": 80
   },
   "person_detail": {
    "type": "string",
    "maxLength": 80
   }
  }
 },
 "states": {
  "shown": [
   "hover",
   "focus",
   "current page",
   "unread count",
   "collapsed group",
   "expanded group",
   "online"
  ],
  "edge": {
   "empty": {
    "status": "handled",
    "evidence": "data-od-list",
    "how": "the Smart UI renderer puts one plain 'Nothing to show yet.' line in an empty list"
   },
   "loading": {
    "status": "handled",
    "evidence": "data-od-slot",
    "how": "the Smart UI renderer draws each marked slot as a quiet block of its size while the data arrives; the static file shows the filled part"
   },
   "error": {
    "status": "not_built",
    "how": "if counts fail to load, hide the counts and leave the links working"
   },
   "disabled": {
    "status": "not_built",
    "how": "for a page the person cannot open, drop the href, set aria-disabled and grey the item"
   },
   "overflow": {
    "status": "not_built",
    "how": "the rail grows with its items; give the nav a scroll box with overflow-y: auto between the search button and the person"
   },
   "long_text": {
    "status": "handled",
    "how": "long page labels and the workspace detail are cut with an ellipsis; the workspace name wraps",
    "evidence": "text-overflow: ellipsis; white-space: nowrap; }"
   },
   "missing_image": {
    "status": "handled",
    "evidence": "data-od-media",
    "how": "the Smart UI renderer swaps a photo that fails to load for a block of the same size with its alt text"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-border-width-emphasis",
  "--ds-color-bg-accent-subtle",
  "--ds-color-bg-inverse",
  "--ds-color-bg-neutral-subtle-hover",
  "--ds-color-bg-success-bold",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-subtle",
  "--ds-color-icon-accent",
  "--ds-color-icon-subtle",
  "--ds-color-surface-base",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-accent",
  "--ds-color-text-inverse",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-font-weight-heading",
  "--ds-font-weight-label",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-standard",
  "--ds-radius-control",
  "--ds-radius-control-sm",
  "--ds-radius-detail",
  "--ds-radius-full",
  "--ds-radius-person",
  "--ds-size-control-md",
  "--ds-size-control-sm",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-2",
  "--ds-space-20",
  "--ds-space-4",
  "--ds-space-6",
  "--ds-space-8",
  "--ds-space-inline-md",
  "--ds-space-inline-xs",
  "--ds-space-inset-lg",
  "--ds-space-inset-md",
  "--ds-space-inset-sm",
  "--ds-space-stack-lg",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-body-sm",
  "--ds-text-code-sm",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-label-md-tracking"
 ],
 "a11y": {
  "summary": "A nav landmark with labelled lists; the current page carries aria-current=\"page\", the collapsible group is a native details/summary, and the switcher and person menus are buttons with aria-haspopup.",
  "roles": [
   "complementary",
   "list",
   "navigation"
  ],
  "keyboard": [
   "Tab moves through the workspace switcher, Search, each page link, the collapsible group heading and the person button",
   "Enter follows a page link",
   "Enter or Space on the group heading opens or closes it, as a native details element",
   "The switcher, Search and person buttons open nothing yet, and Cmd+K is labelled but not wired"
  ],
  "controls": {
   "button": 3,
   "input": 0,
   "link": 11,
   "select": 0,
   "textarea": 0,
   "summary": 1
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/sidebar-nav/component.html",
  "bytes": 16075,
  "script": true
 },
 "source": "brand/showcase/product/02-fennick-approvals",
 "photos": 1,
 "urls": {
  "html": "https://opendesigner.dev/library/sidebar-nav.html",
  "json": "https://opendesigner.dev/library/sidebar-nav.json",
  "page": "https://opendesigner.dev/library/sidebar-nav/"
 },
 "get": {
  "curl": "curl -fsSLo sidebar-nav.html https://opendesigner.dev/library/sidebar-nav.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add sidebar-nav --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component sidebar-nav to this project: https://opendesigner.dev/library/sidebar-nav.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
