Nav/Schema

API reference

Package API

The package exports schema helpers, HTML renderers, live mount helpers, shared prop aliases, class-name constants, and tiny-engine-core runtime helpers.

exports
import {
  createSidebarMenu,
  renderSidebarHtml,
  mountSidebar,
  createMegaMenu,
  renderMegaMenuHtml,
  mountMegaMenu,
  NAV_CLASS_NAMES,
  UI,
  getPrefix
} from "nav-schema";

createSidebarMenu(schema);       // typed identity helper for sidebar schemas
renderSidebarHtml(schema, opts); // SSR/static sidebar markup
mountSidebar(el, opts);          // tiny-engine-core powered sidebar capsule

createMegaMenu(schema);          // typed identity helper for mega menu schemas
renderMegaMenuHtml(schema, opts);// SSR/static mega menu markup
mountMegaMenu(el, opts);         // tiny-engine-core powered mega menu capsule

NAV_CLASS_NAMES;                 // shared generated class-name constants
UI;                              // tiny-engine-core runtime helper
getPrefix("nav-schema");         // resolves prefixed host names

Sidebar helpers

createSidebarMenu() preserves typed schema inference, renderSidebarHtml() returns static markup, and mountSidebar() renders and wires live behavior.

Mega menu helpers

createMegaMenu(), renderMegaMenuHtml(), and mountMegaMenu() mirror the sidebar flow for multi-column navigation.

Attribute hosts

Live mounts use prefixed host attributes internally. You can also pass serialized schema data when integrating with templates.

hosts.html
<div nav-schema-sidebar schema='{"title":"Docs","items":[{"id":"intro","label":"Intro","url":"/docs"}]}'></div>
<div nav-schema-mega-menu></div>

Runtime re-exports

UI, getPrefix, and the tiny-engine-core type helpers are exported from the package and from the sidebar and mega-menu source modules for adapter authors.